Hide user accounts in Tiger's login window

One of the nice things about OS X is that it’s a true multi-user operating system. You can easily create additional users for various uses. Even if you’re the only user of your Mac, you might want to have more than one user. It’s a very good idea, for instance, to create a troubleshooting or testing account, which can be useful when diagnosing system issues (keep your testing account free of your main account’s login items, third party preference panels, and so forth).

You can also create accounts that are configured for various uses—a gaming account with lower screen resolutions and no startup items, a graphics account that’s configured to auto-launch Photoshop, Illustrator, and similar programs. And obviously, if you share your Mac with other family members, you can create accounts for everyone, allowing each person to have their very own workspace.

While this is all well and good, it does lead to one problem—the never-ending login window. With a few added accounts, the formally neat-and-trim login window gains a scrolling interior window, reducing both its functionality and, in my opinion, its aesthetic:

As you can see, I would have to do some scrolling to pick through the various accounts in the login window. And generally speaking, I use most of those accounts only rarely. Wouldn’t it be great if you could hide those accounts you only access occasionally? If you’re running OS X 10.4, you can easily do just that. (It was possible to hide users from the login window in pre-10.4 systems, but it’s not for the faint of heart, as it involves changing the system’s UID for the accounts to be hidden.)

Hiding accounts in 10.4 is much simpler—it takes but a quick trip to Terminal and one command. To do this, all you need to know the short name of each account you wish to hide, as seen in the Accounts System Preferences panel. Open Terminal and type this command:

	sudo defaults write /Library/Preferences/com.apple.loginwindow

HiddenUsersList -array-add account1 account2 account3

In the above example, account1, account2, and account3 represent the short names of three accounts to be hidden. You can hide as many accounts as you wish; just separate each short name with a space. Once you press Return, the hidden users are created.

If you then logout and view the login screen, you’ll notice two changes. First, the users you hid won’t show any more, and second, there’s a new entry for Other:

The Other entry is used to access the accounts you’ve hidden—choose it, and you’ll see entry boxes for username and password. There’s a second benefit (or some may view it as a downside) to this trick: hidden accounts also don’t show in the Fast User Switching menu (unless those users are logged in).

Unhiding accounts

Once an account is hidden, how do you unhide it? If you have the Developer Tools installed, you can use Property List Editor and open the com.apple.loginwindow.plist file in the top-level Library -> Preferences folder. You’ll see an entry for HiddenusersList, and then a line for each user you’ve hidden. Select a user in the list, then click the Delete button. Save the changes when you’re done.

If you don’t have the Developer Tools installed, your best bet is to simple remove all the hidden users—it’s somewhat complex to edit the plist file directly. In Terminal, enter this command:

	sudo defaults write /Library/Preferences/com.apple.loginwindow

HiddenUsersList -array-add

By specifying no names, you’ll reset and empty the hidden users list. Next time you return to the login window, you’ll see all your accounts again.

While I appreciate that Apple has made hiding users much simpler in 10.4, I’m hoping 10.5 takes it one step further: there should simply be a “Hide user in login window” checkbox in the Accounts System Preferences panel.

recommended for you

Protect your Mac

Read more »

Subscribe to the Best of Macworld Newsletter