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!