Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Disable Personal File Sharing's guest access Network
I've just been reading an interesting article on the insecure.org website (home of Nmap) and as I read it, it occurred to me that it probably was a problem having Guest access enabled for AFP (or Personal File Sharing). I checked, and sure enough, if you connect to a Mac with AFP turned on as a guest user, you are given the option to connect to any user's public folder. Granted, hardly anyone stores files in their Public folder, but the main thing is that you can get a list of all users on the machine!

So I decided to see if there was an easy way to turn off guest access (Mac OS X Server has a radio button option). It turns out there is, as long as you don't mind using the Terminal.

Open up the Terminal (in Applications -> Utilities -> Terminal.app), and then type in this command to back up the file we are going to edit:
sudo cp /Library/Preferences/com.apple.AppleFileServer.plist \
 /Library/Preferences/com.apple.AppleFileServer.plist.old
The backslash above should let this copy and paste successfully, but if it doesn't, just remove the slash and the line break, leaving a space before /Library.... Then edit the AppleFileServer.plist file, by typing:
sudo pico /Library/Preferences/com.apple.AppleFileServer.plist
and do a search for guest (hit Control-W, type in guest, hit Return). Change the tag from this:
        <key>guestAccess</key>
        <true/>
to this:
        <key>guestAccess</key>
        <false/>
Save the file (Control-O, hit Return) and exit (Control-X). We now need to restart the AFP server by typing:
sudo killall -HUP AppleFileServer
If you try connecting now, you shouldn't be able to log in using the guest user. Much better!
    •    
  • Currently 3.33 / 5
  You rated: 5 / 5 (6 votes cast)
 
[21,131 views]  

Disable Personal File Sharing's guest access | 10 comments | Create New Account
Click here to return to the 'Disable Personal File Sharing's guest access' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Disable Personal File Sharing's guest access
Authored by: donfarrar on Sep 27, '04 11:52:17AM

To perform this in a truly Mac way -- that means no Terminal commands -- do the following:
1. Option-drag "com.apple.AppleFileServer.plist" from /Library/Preferences to the Desktop. Then option-drag the Desktop plist file to the Shared folder. The one in the Shared folder becomes your backup in case things go awry.
2. Double-click on the newly created Desktop plist file.
3. The Property List Editor is invoked.
4. Turn down the arrow of "Root" in the "Property List" column. Notice that all of the variables and associated values show up.
5. Change "guestAccess" from "Yes" to "No" by clicking on the "Yes" value in the "Values" column and choosing "No".
6. cmd-S (Save) the file.
7. Quit the Property List Editor.
8. Option-drag "com.apple.AppleFileServer.plist" from the Desktop back into /Library/Preferences.
9. Replace the current one.
10. Reboot.
11. Throw away the plist file on the Desktop.
You're done. If you have troubles, option-drag the copy in your Shared folder back into the /Library/Preferences folder, reboot, and you are back to where you started from. No Terminal commands, and more importantly, no Pico editor.



[ Reply to This | # ]
Property List Editor?
Authored by: rhowell on Sep 27, '04 12:23:22PM

Property List Editor is installed with the XCode tools. A default Mac system will not have these tools installed. Instead, double-clicking on this file will open TextEdit, from which you can Search/Replace as in the original hint.



[ Reply to This | # ]
Property List Editor?
Authored by: rhowell on Sep 27, '04 12:24:38PM

Property List Editor is installed with the XCode tools. A default Mac system will not have these tools installed. Instead, double-clicking on this file will open TextEdit, from which you can Search/Replace as in the original hint.



[ Reply to This | # ]
Disable Personal File Sharing's guest access
Authored by: xApple on Nov 12, '06 09:21:21AM

[code]
cp: /Library/Preferences/com.apple.AppleFileServer.plist: No such file or directory
[/code]

So what's happened to the file ?



[ Reply to This | # ]
Disable Personal File Sharing's guest access
Authored by: gdsimms on Sep 27, '04 12:08:47PM
SharePoints lets you set personal file sharing on a per-user basis.

[ Reply to This | # ]
use 'defaults' command
Authored by: daniel_steffen on Sep 27, '04 02:22:28PM

instead of editing plists manually, it's much easier to use the defaults command:

defaults write /Library/Preferences/com.apple.AppleFileServer guestAccess -bool false

c.f. man defaults for details...



[ Reply to This | # ]
Disable Personal File Sharing's guest access
Authored by: imageworx on Sep 27, '04 03:09:08PM

Its also on the OS X server CD. Along with Package Maker.

---
To BeOS or Not to BeOS



[ Reply to This | # ]
Disable Personal File Sharing's guest access
Authored by: glusk on Sep 27, '04 07:35:39PM

No way is it that easy!!!!! I knew SharePoints could do it, as well as other cool tricks, but I've been looking for a long time for a simple way to do this without installing another program. Wow.

Obviously, thanks for the hint.



[ Reply to This | # ]
Disable Personal File Sharing's guest access
Authored by: Uncle Asad on Sep 28, '04 06:08:14PM

I've been searching, without avail, for this hint since the insecure protocols/LaunchServices scare this summer. Thanks! Once again Apple removed/hid a standard feature of pre-X Mac OS! :-(



[ Reply to This | # ]
Sharing Menu
Authored by: NeutronMonk on Sep 29, '04 01:36:37AM
There is a great little "menulet" that I use, called Sharing Menu, that has a drop down menu to toggle File Sharing, Guest Access, Remote Login, etc. The drop down menu also shows who is logged in, and in addition the menu bar icon changes to yellow when a service is on, then to red when a remote user is logged in. I can't say enough about how handy this is, especially for powerbook users who change network enviroments frequently. My Pick of the Week! P.S. Did I mention it's free? :D

[ Reply to This | # ]