How to Hide a Specific User Account from Login Screens of Mac OS X

Feb 1, 2015 - 15 Comments

Hide a specific user account from the login screen of 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 specific user account in Mac OS X

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

Hiding a user account in OS X

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:

Hide a user account from OS X login screen

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.


Related articles:

Posted by: Paul Horowitz in Mac OS, Security, Tips & Tricks


» Comments RSS Feed

  1. Frank says:

    I have the same issue as ‘TS’ with using High Sierra where a hidden user still shows after a cold boot or reboot.

    Does anyone have a solution for this?

  2. TS says:

    I am using High Sierra ver 10.13.6.
    Username was hidden when the user executes log out.
    However, the username appears when it was a cold boot, reboot, and lock screen.
    Please help

  3. ChrisC says:

    Hello! I work in IT and would absolutely love to hide my admin account from my users at the login screen. However, when I input the above terminal command, enter my password, and it appears successful, my admin account still appears at the login screen. We run Filevault2 and are bound to a Windows 2008 enterprise domain, could this be causing it not to work properly? I want to blame Filevault2 as it also prevents “Display login window as: Name and password” from working properly as it requires each account to have permissions to unlock the drive. Any input on how I could get this working would be much appreciated!

    • Adam says:

      I have the same problem, it finishes the command then nothing happens. When I tried it using the command s thing in the boot menu it said eserver error. Can’t find solution

    • Adam says:

      Same, it finishes the command then nothing happens. When I tried it using the command s thing in the boot menu it said eserver error. Can’t find solution

    • Adam says:

      It finishes the command then nothing happens. When I tried it using the command s thing in the boot menu it said eserver error. Can’t find solution

    • Adam says:

      Fixed! Simply go to system preferences/users and groups press the lock and type in your password. right click the account you want to hide and press advanced options. The account name, not full name, is the one you need to type into the terminal

  4. arob says:

    If you have enabled the root account (not enabled by default, nor should it remain enabled), the user “Other” may appear on the login screen but no “Other” user appears in the user preferences.

    To disable root, enter (username is an admin user account on the Mac):

    % dsenableroot -d -u username
    user password:

    dsenableroot:: ***Successfully disabled root user.

    Enabling root is generally only done to “fix” something you muck up using sudo (such as /etc/sudoers). Most “root” functions can be, and should be run using sudo which simply elevates the privileges of the amin user to root for purposes of the command(s) to follow. To enable root:

    % dsenableroot
    username = username
    user password:
    root password:
    verify root password:

    dsenableroot:: ***Successfully enabled root user.

  5. This is great for administrators who want to keep the admin account hidden from users. If they don’t know it’s there, they won’t try to hack into it.

  6. dacbarbos says:

    Why recreate the key instead of changing its value?
    yosemite$ sudo dscl . change /Users/ACCOUNTNAME IsHidden 1 0

Leave a Reply


Shop on and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks


iPhone / iPad



Shop on Amazon to help support this site