Automatic logon can be enabled for Windows, or Mac OS X. We already discussed disabling automatic logon using a script for Windows, so let’s look at doing so for Mac OS X. The variable that controls automatic logon is stored in /Library/Preferences/com.apple.loginwindow.plist in the autoLoginUser key. By default automatic logon is disabled and so you can simply delete that key to disable it, which you can do with the following command:
defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser
You can also enter an autoLoginUser into the field to define the user who will automatically be logged in. You may remember that the loginwindow defaults domain is the same location that login hooks are stored in. In addition, you can also set password RetriesUntilHint. You can also remove the cached field that displays the last user using the lastUserName, which we’ve done a number of times to clear any cached information prior to our deployments.