We’re replacing our “data drive” server at work with a hot little 2U Linux server. It’s a quad-core Xeon X3220 @ 2.4GHz, with 4Gb RAM, just to host a shared drive. Hey, we got a good deal, and we wanted room to grow.
Anyway, we decided Samba was too much of a pain to get running with Macs and Vista. The only way to access this new machine is through SFTP. We’re using SFTPDrive on Windows, ExpanDrive on Mac, and the built-in functionality on Linux.
But, there was the issue of umasks. The umask is the default set of permissions assigned when a user creates a file or directory. We tried setting users’ umasks in their .bash_profile. It worked great at the command line, but it was completely ignored when they connected via SFTP.
Google turned up a link to Jeff Robbins’ blog entry on Setting the umask for SFTP transactions. He shows how to modify your sshd_config file to call a script instead of invoking sftp-server directly. The sample script he offers sets the umask to 0002 before running sftp-server. It was easy to make that change, and now we’re able to turn our co-workers loose on the new machine.