DEV Community

Sandilya Bhamidipati
Sandilya Bhamidipati

Posted on

Hiding user accounts in MacOS

Hiding User account in MacOS

  1. Hiding user account from login window. — Simple
  2. Hiding user account from login window and system preferences — Advanced

1. Simple version

The simple version hides the user account from displaying in the list of user accounts during the login process. The account can be visible from system preferences as well as /Users. Here is how to achieve this effect:

sudo defaults write /Library/Preferences/ HiddenUsersList -array-add <username_to_hide>

And now you can reboot and the username mentioned above will not appear in the login window. If you want to revert this, you can run the following command

sudo defaults delete /Library/Preferences/ HiddenUsersList

2. Advanced version

There are multiple ways of achieving a totally hidden user account. This method involves creating a user account which is no longer visible in system preferences, creating a home folder other than /Users and hiding all shared mount points. This is a true ninja account.

Creating a hidden user account with home directory other than /Users

sudo dscl . create /Users/dummy NFSHomeDirectory /var/dummy
sudo dscl . delete "/SharePoints/Dummy's Public Folder"

This command removes the Public Folder share point for the user with the long name "Dummy”

Top comments (0)