Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

migrated from stackoverflow.com Oct 23 '11 at 19:17

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

1 Answer

up vote 2 down vote accepted

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

In /Library/Preferences/com.apple.AppleFileServer, it's the guestAccess flag, and in /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist, it's the AllowGuestAccess flag.

To change these, execute the following with root permissions:

defaults write /Library/Preferences/com.apple.AppleFileServer guestAccess -bool NO
defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.