0

I am a non-root user on our Linux (Debian) install, and the file/folder permissions on the existing files in my home folder are -rw-rw-r-- and drwxrwxr-x for directories, and if I log into SSH directly (I use putty on Windows 7), then create a new file or folder, it creates it with those permissions. However, if I log in any other way, such as with FTP or SFTP or with my file editor (like Eclipse or Sublime Text) or with anything else, like win-sshfs, any file or folder I create doesn't have group write permission.

I've already added umask 002 to my .bash_profile, logged out of everything and back in, but no dice.

3

This behavior is FTP-/SFTP-server specific. You did not specify what server you are using.

For SFTP, I'm assuming OpenSSH, as that's used by a majority of distributions. For FTP, I'm making no guesses.


The OpenSSH SFTP server does not follow an umask you set in .bash_profile. Instead it uses it's own umask setting. It's a global setting by default. While it can be set per user, it can be set by a root only (it's configured in the sshd_config).

For more details see SFTP-server uploaded files having wrong rights.


An alternative solution (as also suggested in the link above), is to use an SFTP client that allows specifying permissions for uploaded files.

For example WinSCP allows that.

See https://winscp.net/eng/docs/ui_transfer_custom

Setting permissions for uploaded files in WinSCP

(I'm the author of WinSCP)

  • We're using Debian but they just don't have the group write permissions masked properly through SFTP, and FileZilla doesn't let me set a mask, so I'll just use WinSCP. – Dave Netz Jan 21 '15 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.