
Hide/Show MAC OS X user
to hide user in MAC OS X
create the account in System Pref. or by command line
========
sudo dscl . create /Users/$USERNAME
sudo dscl . create /Users/$USERNAME PrimaryGroupID 0
sudo dscl . create /Users/$USERNAME UniqueID 0
sudo dscl . create /Users/$USERNAME UserShell /bin/bash
sudo dscl . passwd /Users/$USERNAME $PASSWORD
sudo dscl . append /Groups/admin GroupMembership $USERNAME
Replace $USERNAME and $PASSWORD with the username and password you want to use.
===============
The new account will be created as a root-level account. If you like, change the PrimaryGroupID and UniqueID to something else.
to see the UID of users
====
dscl . list /Users UniqueID
====
set their UID to be less than 500
to change the UID
====
dscl . -change /Users/will UniqueID 501 1000
====
above command changes UID from 501 to 1000 for user “will”
following command will hide all such users from login window (system pref. accounts window)
====
sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool TRUE
====
to hide an account manually use this command
====
sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add ‘account1’
====
after hiding the users there can be “others” appearing in the login window. to remove this use this command
====
sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWOTHERUSERS_MANAGED -bool FALSE
====
you can use above commands in reverse to show the users in System Prefs. e.g.
command below will show the hidden users in System Prefs and Login windows
====
sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool FALSE
====