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“.
August 25th, 2009, 3:41 PM
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 ?