Mount AFP Shares Read Only

In some cases you may want to mount shares over AFP read only. Sure you could mount SMB or NFS shares read only, but then you could run into some nasty resource fork issues. Since OS X Server doesn’t allow you to share AFP read only, you will just have to mount it read only.

In my case, I have a backup share that contains snapshots of my user’s data for a week. I want them to be able to mount the share for recovering data, but I don’t want them to accidently delete or write over a file. So I made a little shell script that will mount the share.

mkdir /Volumes/Backup
mount -rt afp afp://username:password@yourserver/yourshare/ /Volumes/Backup
open /Volumes/Backup

This will simply mount the share read only and open a finder window to its contents. On the server, I only gave access to one user, and use that username in the script. I pop this into an applescript and compile it to an application so that users can’t just pull the user name and password if they’re feeling nosey.

Posted by Joe Mullins at September 23, 2004 03:39 PM |TrackBack