How to create a Hidden User Account
Those who manage large installed bases of Macs need to maintain one or more local administrative accounts on the machines, for remote administration, maintenance or troubleshooting. But, it can be undesirable to list an obvious administrator account in the Loginwindow; that same account hangs in the Fast User Switching menu, and in the Accounts Preference Pane. What to do?
Much experimentation, and some lucky finds on the Internet, has turned up the configuration to hide a user account on 10.6, and in later versions of 10.4.
- In the System Preferences, Under the Accounts Pane, create an administrator account called Hidden Administrator, Short Name would be hadmin, password: anything you want it to be. Turn off automatic login under the Login Options
- In the System Preferences, Under The Sharing Pane, turn on Remote Management and click on the options button. Select your choice of Remote Management tools on the next window. This has to be done under the Hidden user account and it has to be done before hiding the user and not after.
- Go back to the Accounts pane of System Preferences and unlock the preference pane.
- Control-Click on the Hidden Administrator Account and select Advance options. A window will appears that says Advanced Options, this is where You will change the User ID and where to create a Home Directory for the hidden user. The User ID Must be under 500 (for a list of User IDs that is being used, go to the Terminal Application and type in: dscl . list /Users UniqueID). Change the User ID to 499, and change the Home Directory from /Users/hadmin to /var/hadmin
- Restart the Machine for the System to build the Home Directory under the /var directory.
- After the Machine has restarted, you may delete the hadmin folder in the /Users/ (Note: if you have any information from the hidden user account before changing the location, do not delete until you back it up.
- At the finder go to the Go pull down Menu and select Go to Folder and type in: /var/hadmin to make sure the system has created the Home Directory for the Hidden User.
Hiding the account:
- Launch the terminal Application and type In the following:
- sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool TRUE
- Type in the password when prompted
- Next, type in the following command: sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList –array hadmin
- Restart The Machine and try the hidden user account.
The first line will hide users with a UID below 500. The second line will add your user to the list of hidden accounts. This was enough prior 10.4.11. Now, if such a hidden account is created, the login window and Fast User Switching menu will show an option for "Other...,"
But if You want to hide the “Other…” option in the login window, Type the following to disable the "Other..." listing from the Loginwindow and the Fast User Switching menu:
sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWOTHERUSERS_MANAGED -bool FALSE
- Reboot to ensure all changes took place, login to your Hidden administrator account to make sure it works, and you're done.