Dave, I remember in MacOS 9 that it was pretty easy to disable guest access to your Macintosh, but in Mac OS X I can’t find any clue how to change this so that while I offer file sharing off my server, it’s only for people with actual accounts. Can you shed some light on this?
You’re right and I don’t really understand why Apple made it seemingly impossible to disable guest access while still running file sharing.
Fortunately, if you’re willing to muck about in the innards of your system, guest access can be disabled from within the Terminal (Applications -> Utilities -> Terminal).
The first step is to open up a Terminal window and crack your knuckles. It’ll help you feel like a real Mac OS X power user!
Now, type in cd /Library/Preferences to move into the correct directory on your system. You can confirm it worked by typing pwd to see where you are in the file system.
Next, it’s time to save the existing preferences file for Apple File Sharing before we fix it. Just in case…
$ cp com.apple.AppleFileSharing.plist \ com.apple.AppleFileSharing.plist.bkup $
Now that you have a backup copy in case things go horribly wrong (but they won’t, don’t panic), it’s time to edit the preferences file to disable guest access. To accomplish this, you need to be root so that you have write permission with the file, so you’ll need to use the sudo utility.
Using your favorite editor (mine is vi) you need to edit the com.apple.AppleFileSharing.plist file. Here’s how I do this using vi and sudo: sudo vi com.apple.AppleFileSharing.plist. It prompts for the sudo password: type in your account password again, and if you’re authorized to use sudo, you’ll be editing the file.
Once you’re in the file, you need to search for “guestAccess”, which will look like this:
To disable guest access, carefully delete the word ‘true’ immediately following the guestAccess entry, then replace it with the word ‘false’. The final line will look exactly like this:
Make double-sure that you still have the < and the /> surrounding the new false entry, then save the file, quit, and you’re done!
The easiest way to have the Apple File Sharing system know about this configuration change is to reboot your computer, but you can also go to Apple -> System Preferences -> Sharing, then click on the Services tab and turn off, wait 30 seconds, and turn back on File Sharing.
This is a remarkably complex solution because there is no simple way to turn off guest access on your Mac running Mac OS X. I don’t really understand why Apple’s made it this hard, but now you know how to fix it.