Domanda

Hello i currently have a folder set up that can have files uploaded to using a sftp.

 drwxrwxr-x. 2 cypress cypress  4096 Apr 30 15:24 sourceit

But when i file gets uploaded it gets uploaded as

-rw-r--r--. 1 cypress sftpusrs    7 Apr 30 15:24 test.file

what do i have to do to set it up so when i file gets uploaded it will automatically set the permissions to

drwxrwxr-x. 1 cypress sftpusrs    7 Apr 30 15:24 test.file

Thank you for your help.

I currently have everything set up in openssh sshd_config for ftping

Match user cypress
ChrootDirectory /mnt/cypress
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp
È stato utile?

Soluzione

Modify or Add this line to your sshd_config

ForceCommand internal-sftp -u 2

which should apply a umask of 002.

With umask or SFTP, there is no way to automaticaly put a file executable, it would be a huge security risk. You must run chmod in a separate command in order to do that.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top