Is there any way to "Allow Guest Account to log in to this computer" via the command line?
8,269
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
Read
sudo defaults read /Library/Preferences/com.apple.loginwindow GuestEnabled
#1 -> Enabled, 0 -> Disabled
Write
sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool YES|NO
Author by
Shelby V
Updated on September 18, 2022Comments
-
Shelby V over 1 year
How to enable “Allow Guests to log in to this computer” option on Mac OS X 10.8 (Mountain Lion) via command line?
-
slhck about 11 yearsThere 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?
-
-
Tim Dearborn over 5 yearsThis does not work on 10.14.x for devices that have never had the Guest account previously enabled. I posted a question in regards to this and 10.14 on Ask Different at apple.stackexchange.com/questions/346088/…