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.

How to enable "Allow Guests to log in to this computer" option on Mac OS X Mountain Lion via command line ?

share|improve this question
There are quite a few things going on in the background when you tick the box. Not easy two wrap this all up in one or two lines of code. Is there a specific reason you need to do this via command line? –  slhck May 19 '13 at 14:13
@slhck Yes, I am planning on automating the installation of my workstation. How about with Apple Script ? –  David Andreoletti May 20 '13 at 0:48

1 Answer 1

The option "Allow guests to log in to this computer" is stored as "GuestEnabled" key in /Library/Preferences/com.apple.loginwindow.plist

You can change it by using defaults command with root permission, tested on MountainLion 10.8.4


sudo defaults read /Library/Preferences/com.apple.loginwindow GuestEnabled
#1 -> Enabled, 0 -> Disabled


sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool YES|NO
share|improve this answer

Your Answer


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.