I am setting up a file server where users log in via SFTP. I want all users to have the same permissions to read and write any file. Since they all have different accounts with different passwords, i end up with something like this:
-rw-r----- 1 user1 sharing 308 Jul 6 12:03 test2.rtf -rw-r----- 1 user2 sharing 308 Jul 6 12:16 test3.rtf
The group is called
sharing which contains all the users. The problem is when files are written, the default permission for groups is read only.
I have tried setting the umask in
Subsystem sftp /bin/sh -c 'umask 0002; /usr/lib/openssh/sftp-server' Match Group sharing ChrootDirectory /files/ ForceCommand internal-sftp -u 002 AllowTCPForwarding no X11Forwarding no
The facl for the directory is this:
# file: . # owner: root # group: sharing # flags: -s- user::rwx group::rwx group:sharing:rwx mask::rwx other::r-x default:user::rwx default:group::rwx default:other::---
also in these places:
init.d/rc:umask 002 init.d/ssh:umask 002 bash.bashrc:umask 002
If I log in via SFTP, i get permissions of 640. If I disable the sftp and log in as user1 via ssh, and touch a new file, i get permissions of 660 - which is what i want.
So how can I get this to work via SFTP?
This is debian 7 btw.