Subscribe to MacYourself via RSSFollow MacYourself on Twitter

Mac login window tricks, Part 3: Hide certain user accounts

Mac login window tricks, Part 3: Hide certain user accounts

For the 3rd installment of our 4-part series on Mac login window tips and tricks, we’re going to show how to hide user accounts from displaying. This can be particularly useful when you have a number of users who don’t log in very often.

There are a few different scenarios when hiding certain user accounts from your Mac’s login window can be beneficial. For example, let’s say you have five limited user accounts (for each member of your family) and an administrator account that only gets used for occasional system maintenance. In this instance, you’re the only frequent user of the computer while the others just hop on every now and then. That’s six accounts taking up space on the login screen when only one really requires quick access. Hiding their accounts is good for overall tidiness and hiding the administrator account is a smart security move.

But what about when you do want to access those hidden accounts? No problem — an “Other” option will appear in the login window which allows you to type in the username and password manually. Now that our hypothetical situation has been established, let’s figure out how to do this.

First we’re going to need the “short name” of the users that will be hidden. To find this information, open System Preferences and click on the Accounts pane. Right-click on each of the users in the list and select “Advanced Options.” The window that comes up will contain a field which shows the short name for that user.

In Terminal (Applications > Utilities), copy and paste the following command. Be sure to replace the “user1”, “user 2”, etc. with the short names you want to hide. Separate each of them with a space, as shown below. An explanation of the code’s contents will follow.

sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add user1 user2 user3 user4

sudo
Tells Terminal to execute the command through the root user. The root user is the system administrator account.

defaults write /Library/Preferences/com.apple.loginwindow
Specifies we’re going to be editing the preferences file called “com.apple.loginwindow” located in the Library directory.

HiddenUsersList -array-add
Creates a parameter in the aforementioned preference file with a set of values consisting of the user short names.

Press Enter/Return on your keyboard and type your administrator password if prompted. Log out to see the changes you’ve made to the login window. Only the accounts you didn’t specify in the Terminal command should be there, plus the “Other” option. If you later decide you want to show the hidden users again, copy & paste the following command in Terminal:

sudo defaults delete /Library/Preferences/com.apple.loginwindow HiddenUsersList

For more Mac login window tricks and tips, check out the other segments of this 4-part series: “Mac login window tricks, Part 1: Unleash hidden system information“, “Mac login window tricks, Part 2: Add a custom welcome message“, and “Mac login window tricks, Part 4: Change default background image“.

21 Comments Have Been Posted (Leave Your Response)

Thanks! I made a secret admin account with this!
-egmoo

When I set the Admin user be hidden it works but there’s no “other” menu in the list. How to have this appear in the login screen ?

Notha,
Do you have any users accounts still visible or did you hide them all? If you’re hiding all of the users on your Mac you might be better off not using this method. Instead, just go to System Preferences > Accounts > Login Options and then select the option to display login window as “Name and password”.

How do I make a hidden account without it showing Other in the login windows and stay hidden in the system preferences. If what you said works then the Other and The users in the Syss Prefs will show up. Thanks a lot!

Jibz,
I’m not sure I understand your question, but I’ll give it a shot. To the best of my knowledge, you cannot prevent the Other option from displaying in the login window. How else would you log in with the hidden user, aside from going to a basic name & password login window?

I just want the admin account to install applications, but I wont be ever logging into it. Thanks!

Greetings, Does this work on OS X 10.6 aka Snow Leopard?

The Illusive Man,
Yes, this works in 10.6.

Is is possible to hide accounts in the Accounts tab within System Preferences (I already use the “Name and Password” option to log in)?
Thanks!

Am I correct in understanding that what you are trying to accomplish is hiding a particular user account AND also to hide the “Other…” button? Here is my situation: I have the “Guest” account enabled but I wanted to hide it so that I may log a guest onto the computer, but not have that option displayed by default on the menu. I also wanted to hide the “Other…” option (similar to pressing “CTRL+ALT+Delete+Delete on the classic Windows logon screen).

Here’s the solution:
1.) sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add short_username
2.) sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWOTHERUSERS_MANAGED -bool FALSE

That should do it!

OH… and to get to the “Name and Password” fields while the “Other…” option is disabled, do the following:

1.) At the list of users, press the down arrow to highlight one of the accounts.
2.) Press Option+Enter to switch to the “Name and Passwords” fields.

To re-enable the “Other…”:

sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWOTHERUSERS_MANAGED -bool TRUE

To restore hidden accounts:

sudo defaults delete /Library/Preferences/com.apple.loginwindow HiddenUsersList

Everything seems to work here but I have one problem… while the hidden user acct is logged in it DOES seem to appear in the fast user switching menu… so it’s only hidden while logged out. is there a way to hide the acct from this menu even while it’s logged in?

just turn off fast user switching

Hello this is a great guide but there is a flaw I noticed which is when you are logged off you can’t see it but I have two admin accounts and it says my username’s imac, is there a way to fix this?

Hi there, I hope you can help me out here! Last year I noticed a new log in account listed at start up, ‘Other’ which requires a username and password. I logged into my account and checked the ‘Accounts’ hoping to delete the second login, but ‘Other’ is not listed. I have been searching but keep coming up short. So two questions, how could this ‘Other’ account have been created and how can I get rid of it? – TIA!

HELP!

I have no idea what I’ve done but I can’t see my account, only a guest account which has no privileges! I’m freaking out that I’ve lost a years worth of university work! Can anyone help? All the data is on my hd but I can’t log in to access it :(

Did you turn on remote login in the sharing preference for an admin account? this would allow you to ssh into the machine and run command line options to un-hide the account(s).

Jeremy, when you look at the account in the preferences and right click the account you get “advanced options” , the account name listed here, is the true unix account name, or the account name under the covers. It would not let you create two identical account names. I would not change any of these setting without a deeper knowledge into how it is done with unix. Basically Mac OSX is unix under the covers.

Hi there,

Im a total noob to mac and when entering the lines of code into
Terminal nothing happens. Not sure if i’m doing something wrong or am simply over looking something. id be really grateful for any feedback

[…] Mac login window tricks, Part 3: Hide certain user accounts | MacYourself […]