1. Log in as an admin user.
2. Use this Terminal command. Substitute the short name of the user that you want to hide for “hiddenuser”:
sudo dscl . create /Users/hiddenuser IsHidden 1
The user account is also hidden in System Preferences the next time it’s opened. This command can’t be used with the Guest user account. Learn how to manage the Guest user account.
Show a hidden user account
If you want to show the hidden user, set the user’s IsHidden attribute to 0:
sudo dscl . create /Users/hiddenuser IsHidden 0
If you want, you can delete the IsHidden attribute instead.
Hide the home directory and share point
You can move the hidden user’s home directory to a place that’s not visible from the Finder. And you can remove the hidden user’s Public Folder share point.
This command moves the home directory of “hiddenuser” to /var, a hidden directory:
sudo mv /Users/hiddenuser /var/hiddenuser
This command updates the user record of “hiddenuser” with the new home directory path in /var:
sudo dscl . create /Users/hiddenuser NFSHomeDirectory /var/hiddenuser
This command removes the Public Folder share point for the user with the long name “Hidden User”:
sudo dscl . delete "/SharePoints/Hidden User's Public Folder"
Published Date: October 10, 2018