How to Hide a Specific User Account from Login Screens of Mac OS X
Mac users who have multiple user accounts on a single machine may sometimes wish to hide a specific user account from appearing on the login screens of OS X. This is fairly common for systems administrators who want to hide an admin account that can be used for direct or remote troubleshooting, but it can also be applicable to other users for a variety of reasons. By hiding an account this way, the account login still exists if it’s known and it can still be accessed from remote login and screen shares, but does not appear at the boot screens as a login option.
Note this method is geared towards hiding a specific user account from the login screen, applicable to Macs with multiple user accounts. If you simply want to not show all avatar icons at the boot login of OS X, you can hide all usernames from the login window with an OS X Preference setting, which will display a simple login form rather than any hint at what user accounts are on the Mac.
Targeting a specified user account to hide requires you to know the users account short name, and having some comfort with using the command line. To get started, launch the Terminal in OS X and have the account short name handy. The short name is almost always the same as the users home directory, the latter is what we’re actually using to hide and unhide the accounts.
Hide a User Account from the Login Screen of Mac OS X
This works in OS X Yosemite (10.10 and newer). The general syntax to use to hide an account is as follows, replacing ACCOUNTNAME with the user home directory of the account to no longer display:
sudo dscl . create /Users/ACCOUNTNAME IsHidden 1
For example, to hide the user account “osxdaily” on a Mac with the given user directory being /Users/osxdaily, the syntax would be:
sudo dscl . create /Users/osxdaily IsHidden 1
On reboot you will notice the target account is no longer visible in the avatar list. The account will also become invisible to Fast User Switching menu and the general login and logout menu of OS X. Nonetheless, users who are aware of the account can continue to access it through SSH, screen sharing, remote login, or even the GUI login panels, assuming they know it exists.
Upon boot, this is the login screen that specified account would no longer appear at:
Note that you can actually go further and hide the entire user directory from being visible as well as the login name, which basically makes the entire user account invisible (yet still usable) to the Mac except by someone who either knows how to find it, or that it exists to begin with. We’ll cover that separately.
Unhide the User Account from Login of OS X
Revealing the user account and going back to the default setting of displaying the specified user at login screens, windows, and the Fast User Account switching menu, is also quite simple. Simply replace the 1 with 0 and run the same command, again targeted at the user account short name / directory name.
sudo dscl . create /Users/ACCOUNTNAME IsHidden 0
As before, rebooting the Mac will reveal the specified account again at the login screen of OS X.
Aside from the obvious uses for a systems administrator, there are other practical uses for this too. Perhaps you want to avoid user confusion on a multi-user Mac, hide an admin account so that it’s not used, not show an infrequently used new user account that is for a particular purpose, maintain some privacy by not revealing a unique personal account, or maybe just not show a general guest account that remains active but not visible as it’s rarely needed. Whatever the desired intention or reason, this works quite well and can be reversed quickly if necessary.