HT203998: How to hide a user account in OS X

Learn about How to hide a user account in OS X
uddipatel

Q: If I login from one account and logout from them

If I login from one account and logout from them, I can not see the user which I made hidden using the above commands, but when I restart my mac I can see that hidden user on login screen, please help, I don't want to see the hidden user even after restart.

MacBook Pro with Retina display, OS X Yosemite (10.10.1), null

Posted on Jan 21, 2015 7:49 AM

Close

Q: If I login from one account and logout from them

  • All replies
  • Helpful answers

  • by judysings,

    judysings judysings Jan 21, 2015 7:51 AM in response to uddipatel
    Community Specialists
    Jan 21, 2015 7:51 AM in response to uddipatel

    Hi uddipatel,

    Welcome to the Support Communities!  Here is how you hide a user account in the login window on your Mac:

     

    How to hide a user account in OS X - Apple Support
    http://support.apple.com/en-us/HT203998

     

    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
    

    You can optionally delete the IsHidden attribute instead of setting it to 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"
    

    Hide a user account in earlier versions of OS X

    There are three ways you can hide a user in versions of OS X earlier than Yosemite.

    Set the Login window to display name and password fields

    In the Users & Groups preferences pane (Accounts pane in Mac OS X v10.6 and earlier), click Login Options, then select "Display login window as: Name and password".

    With this enabled, no user accounts are listed in the Login window.

    If changing the Login Window to only display the name and password fields does not meet your needs, then you can use the following steps in this article to hide a user account.

     

     

    Add users to the HiddenUsersList (advanced)

    With Mac OS X v10.4 and later you can hide users from the Login window by adding them to the HiddenUsersList array in the /Library/Preferences/com.apple.loginwindow.plist file. The following command will hide the users "mei" and "anne" from the Login window:

    sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add mei anne
    

    Note: These users will still appear in the Accounts (Mac OS X v10.6 and earlier) or Users & Groups (OS X Lion) pane in System Preferences.

    Lower the user's UID and enable the Hide500Users option (advanced)

    You can use the advanced steps below to change a user's UID, adjust their home directory permissions and enable the Hide500Users option. An example user account "tom" is used below.

    The following sample Terminal command changes the user tom's UID to 401. Note: Check to make sure the new UID is not in use before making this change.

    sudo dscl . -create /Users/tom UniqueID 401
    

    This command adjusts the permissions of the user's home directory:

    sudo chown -R tom /Users/tom/
    

    Enable the Hide500Users option with this command:

    sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool YES
    

     

    Last Modified: Dec 8, 2014

     

    All the best,

    - Judy