Enable Guest account and set as default login user via CLI

What I want to accomplish:

I'm deploying an image to several iMac kiosk style machines in a University setting. I want to use an existing image, which does not have the Guest account enabled, or have an automatic login setup.

Using a post-deployment configuration script which I run at first boot after deployment using a LaunchDaemon, I've tried to accomplish this by doing the following:

1) Took a copy of /var/db/dslocal/nodes/Default/users/Guest.plist from a machine already configured to have Guest account enabled, and copy it into place on the newly imaged machine. This should enable the Guest account, no? Command: +tar -C /var/db/dslocal/nodes/Default/users/ -xzf ${filesDir}/Guest.plist.tar+
2) Set the autologin user to use "Guest". Command: +defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser Guest+

Since the "Guest" account should not have a password, I figure copying a new version of /etc/kcpassword into place is not necessary.

After attempting this, computer boots up to normal loginwindow, requiring a username and password. Additionally, the "Guest" account cannot login with no password.

I'm guessing that the appropriate way to enable the Guest account is with a series of dscl commands, rather than stupidly copying a version of Guest.plist into place on the destination machine.

I've googled all over and been unable to find a solution to this. Can anyone help?

Thanks!

Message was edited by: ehzastrow

iMac7,1 through 10,1, Mac OS X (10.6.6)

Posted on Feb 22, 2011 10:39 AM

Reply
3 replies

Feb 22, 2011 3:10 PM in response to ehzastrow

OK, so after some more tinkering, I think the only issue here is how to enable a guest user via the CLI. After that setting the system to use Guest as the default login user should be as simple as

defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser Guest

So, if anyone knows how to enable Guest account via CLI, I'm all ears 🙂

Jun 14, 2011 7:34 AM in response to ehzastrow

Hi


"if anyone knows how to enable Guest account via CLI I'm all ears"


sudo dscl . -create /Users/Guest UserShell /usr/bin/true


enables the account


sudo dscl . -create /Users/Guest UserShell /usr/bin/false


disables the account


The command is all on one line. Root does not work unless you have a password specified. There is no echo in Terminal so you won't see the password being typed.


HTH?


Tony

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Enable Guest account and set as default login user via CLI

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.