Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 users on my Mac OS X Server, both in the group 'wheel'. If User A creates a file through SFTP/FTP, User B can read the file, but not write to it, since the default file permission is 644, which allows the owner to read/write, but only allows the group to read.

How can I change the default FTP & SFTP file permissions to 664 on Mac OS X 10.8?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

The default new file permissions are controlled by the umask setting. You'll want a umask of 002 to get permissions set to 664.

For FTP servers I've usually seen the umask setting in the ftp server config file. For SFTP, because that's related to your usual command shell, I think you'll need to change the default system umask for those users. (or better yet, if you can change the umask only for the sftp subsystem, that would be better)

That said, on the linux systems I'm more familiar with, the shared write capability is handled by something called a User Private Group (UPG) scheme. That scheme creates a new group for each new user and makes it their primary group. In these systems, the umask is set to 002, meaning permissions will come out 664 (subtract from 666 the umask to get resultant perms for files. use 777 for dirs). In these systems, to get shared write between users for files in a given directory, one normally sets the directory's group to a common group that both are members of, and then does a "chmod g+s directory_name/".

I'm not that experienced with MacOS, but found a great article that talks about setting up UPG in OSX 10.3 or later: http://hints.macworld.com/article.php?story=2006010714524168

I personally would try to find out how to do this for the sftp subsystem only instead of applying it to the system as a whole. I don't fully understand the impact of changing the umask to 002 globally on a system that shipped with umask 022. The things I worry about are things like - what perms does files created by root end up with? what impact does that have? What about system accounts? etc.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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