Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to disable Guest Account from terminal.

I need the same effect like disabling System Preferences → Accounts → Guest Account → Allow guests to connect to shared folders.

I think Guest Access is disabled by default on Lion, So I need it for 10.5, and 10.6.

share|improve this question

migrated from Oct 23 '11 at 19:17

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

On OS X Lion, the preference is internally realized as two separate options:

In /Library/Preferences/, it's the guestAccess flag, and in /Library/Preferences/SystemConfiguration/, it's the AllowGuestAccess flag.

To change these, execute the following with root permissions:

defaults write /Library/Preferences/ guestAccess -bool NO
defaults write /Library/Preferences/SystemConfiguration/ AllowGuestAccess -bool NO

Not sure if these are the same in previous versions of OS X. Use defaults read <path> to find out if these options exist on your system.

You might need to relaunch the sharing service for the changes to take effect.

share|improve this answer
Thanks it works good for me. It does disable Guest Account if you use only first line for AppleFileServer. Do you have idea what is SMB guest access seperately?Because it shows after first line, that user is disabled.Thanks! – User1234 Oct 23 '11 at 19:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .