I have a SFTP server (openssh/sftp-server) and I would like to set umask 002 for users using this service. I tried setting PAM (pam.d/common-session), and .profile for each user, but no luck.
With SSH login everything is fine, but when I try with SFTP (with gFTP) I have the 022 umask set.
I already tried to use a wrapper for sftp-server that is changing the umask before calling the sftp-server, no luck.
Any help? Thanks a lot!
Subsystem sftp /bin/sh -c 'umask 0002; /usr/lib/openssh/sftp-server'– Steve Clay Jul 31 '11 at 01:23Subsystem sftp internal-sftp -u 022– leonheess May 13 '20 at 10:34-uargument to anyForceCommands you have in your/etc/ssh/sshd_configas well. – Frans Jul 14 '22 at 06:12