How to enable “Allow Guests to log in to this computer” option on Mac OS X 10.8 (Mountain Lion) via command line?

  • 1
    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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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