Press "Enter" to skip to content

Setting umask on Tiger Server FTP

We setup our hosting environment in such a way that a site is tied to a Group and anyone in that group (usually just the one user) can do anything in that Sites folder. We provide both AFP and FTP access to our clients Site folders and although the controls for making AFP propagate the proper permissions (group read/write) are readily available, FTP is a different story. Users uploading files by FTP tend to have their documents set with rw-r-r. Under Panther Server, I had edited the ftpd.conf file, but had to LOCK that file as the servermgr software would overwrite the file and wipe out my umask directive even if I merely OPENED Server Admin utility. Of course, then every time I did, Server Admin would complain that the FTP service was broken. Very annoying.

With Tiger, however, I have a little more flexibility as I can now edit the LaunchDaemon plist file and give xtfp an additional command line argument whenever it is launched by launchd.

Here is the procedure:

launchctl unload /System/Library/LaunchDaemons/ftp.plist

edit /System/Library/LaunchDaemons/ftp.plist  and add a new ProgramArgument:

This:

<key>ProgramArguments</key>
<array>
<string>xftpd</string>
<string>-a</string>
</array>

becomes:

<key>ProgramArguments</key>
<array>
<string>xftpd</string>
<string>-a</string>
<string>-u0002</string>
</array>

and then to complete the change:

 launchctl load /System/Library/LaunchDaemons/ftp.plist

and that’s it.

That is now in my little toolkit of tweaks to make to OS X Server when installing. You do have to make sure that change isn’t wiped out by some OS update.

Leave a Reply