How to add hidden user

How do I add a hidden administrator user to my Mac if possible? I don't want it to show up on the login screen.


Solution 1:

Try this hint from Apple Support. There are distinct differences between Yosemite and all earlier OS X versions.

I'll copy/paste the Yosemite commands here so as not to offend the 'no solitary links in answers' demigods.

Quoth Apple Support:

Hide a user account in OS X Yosemite

You can prevent a user account from appearing in the login window in OS X Yosemite by using these steps:

  1. Log in as an admin user.

  2. Use this Terminal command, substituting the short account name name of the user you wish to hide for “hiddenuser”:

    sudo dscl . create /Users/hiddenuser IsHidden 1
    

If you later want to show the hidden user, set the user’s IsHidden attribute to 0 like this:

sudo dscl . create /Users/hiddenuser IsHidden 0

Additional Options

You can also move the hidden user's home directory to a place not visible from the Finder, and remove the hidden user's Public Folder share point.

The following command moves the home directory of "hiddenuser" to /var, a hidden directory:

sudo mv /Users/hiddenuser /var/hiddenuser

The following command updates the user record of "hiddenuser" with the new home directory path in /var:

sudo dscl . -create /Users/hiddenuser NFSHomeDirectory /var/hiddenuser

The following command removes the Public Folder share point for the user with the long name "Hidden User”:

sudo dscl . -delete "/SharePoints/Hidden User's Public Folder"

Logging in to this hidden account

To access this hidden admin account from the login screen, press the down arrow to select any user (make sure the password entry box is not open), then press Opt-Return.

This will bring up the blank name and password fields, allowing you to sign into to the hidden admin account.

Display all users (including hidden)

Remember that a hidden user can still be found, do not use this as a security measure. To show a list of all possible users, use dscacheutil

dscacheutil -q user

or to display all users in the 'Users' group (5**)

dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]'