[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sftp and umask



Am Dienstag, den 09.11.2004, 03:16 -0500 schrieb Robert Storey:
> Not sure if you can do exactly what you asked, but you could put the
> following in a script and run it once a day on the necessary /home
> directory:
>   find ./ -type d -exec chmod 775 {} \;
>   find ./ -type f -exec chmod 664 {} \;

Ok, I try to make it clearer ;-)
There is a directory:

/var/www/website
drwxrwsr-x    6 root     website     4096 Nov  8 12:46 .
-rw-rw-r--    1 root     website       23 Sep  1  2003 file
drwxrwsr-x    3 root     website     4096 Nov  8 12:47 directory

When I connect with ssh I can do the following, like we want:
/var/www/website# touch newfile
/var/www/website# ls -al newfile
-rw-rw-r--    1 root     website        0 Nov  9 20:27 newfile
/var/www/website# touch newdir
/var/www/website# ls -ald newdir
-rw-rw-r--    1 root     website        0 Nov  9 20:28 newdir

When I upload this file and directory via sftp the rights are,
but should be like the ssh behaviour:
/var/www/website# ls -al newfile
-rw-r--r--    1 root     website        0 Nov  9 20:27 newfile
/var/www/website# touch newdir
/var/www/website# ls -ald newdir
-rw-r-sr--    1 root     website        0 Nov  9 20:28 newdir

The umask is set in /etc/profile or in the local ~/.bashrc
with "umask 002" instead of the default "022".
In the sshd_config we have "UseLogin yes" because without the
umask from the profile files is not used. These sshd-config
is set correctly as we see after ssh logins.
But why sftp does not work with this because sftp is a subsystem
from the sshd.

Thanks for your help.

Matthias



Reply to: