Free tech support / small logo


How do I disable guest access on my Mac for wireless users?

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?

Dave's Answer:

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:

<key>guestAccess</key>
<true/>

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:

<false/>

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.









Subscribe!
Never miss another Q&A article! Click to subscribe: Add to Google Reader Add to My Yahoo! Subscribe in NewsGator RDF XML
Comments

In more recent versions of Mac OS X the file involved is /Library/Preferences/com.apple.AppleFileServer.plist

This whole procedure can be simplified to one Terminal command:

sudo defaults write /Library/Preferences/com.apple.AppleFileServer guestAccess 0

Posted by: Curious Rabbit at November 3, 2005 5:36 PM

@Curious Rabbit, thanks a lot buddy, exactly what I was looking for!

Posted by: Pori at July 1, 2010 6:12 PM

Hi,
I did exactly as you said, however, as soon as I type in sudo vi com.apple.AppleFileSharing.plist, I get prompted for the password, after I add the password I don't see anything but a bunch of line characters on the left side of the screen with the word "insert" at the bottom. I don't see any text what so ever, especially pertaining to guest access. Now it appears to have messed up the file since I exited. As I attempt to go back in I get a message that reads,

E325: ATTENTION
Found a swap file by the name ".com.apple.AppleFileSharing.plist.swp"
owned by: root dated: Wed Apr 6 12:54:56 2011
file name: /Library/Preferences/com.apple.AppleFileSharing.plist
modified: YES
user name: root host name: AQP05004GDAS.local
process ID: 1113
While opening file "com.apple.AppleFileSharing.plist"

(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.

(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r com.apple.AppleFileSharing.pl
ist"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".com.apple.AppleFileSharing.p
list.swp"
to avoid this message.

Swap file ".com.apple.AppleFileSharing.plist.swp" already exists!
-- More --

Please help. This is a brand new imac running OS X 10.6.4

Thank you in advance for your help

Posted by: ANTHONY FERRUGIO at April 6, 2011 11:39 AM

I have something to say, now that you mention it, but ...
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you for all your efforts on this Web site by buying you a cup of coffee!

I do have a comment, now that you mention it!











Remember personal info?


Please note that I will never send you any unsolicited email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Recent Entries


Search
I Need Help!
Need Help? Ask Dave Taylor!


© 2002 - 2012 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.