Search code examples
macosaccountsdscl

Hidden accounts on OSX


The traditional method of creating a hidden user account on OSX (i.e does not show up on the login window or system preferences > accounts pane) is to create it with a UID of less than 501.

However, on 10.8 the accounts that I'm creating with lower UIDs are still showing up in the accounts pane in system preferences..

Did this feature change?

And if so, then how are the other accounts being hidden?


Solution

  • You need to tell the login screen to hide low-numbered accounts:

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

    This used to be the default behavior, but it changed... quite a while ago. Alternately, you can hide specific accounts by name:

    sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add "hiddenaccount"
    

    See Apple's KB article #HT5017: How to hide a user account in OS X.