Wednesday 8 February 2012

Creating Hidden OSX Users


Create a normal admin account via System Preferences>Users & Groups
Right click on account and goto advanced options ( shown below )
Run the following Command to check current users ID


dscl . list /Users UniqueID ( will list all User ID's in use )
or 
dscl . list /Users UniqueID | grep XXX ( will return an account name & ID if its in use)


where XXX is the ID you wish to use.


Now set the USER ID of the account you wish to hide to a unique ID under 500.


Change the Home directory to a  new location as well, e.g. /var/.macadmin


You now need to move the folder and set permissions for the user
sudo mv /Users/macadmin /var/.macadmin
sudo chown -R macadmin /var/.macadmin


We also want to remove the Public and Sites folders for this user
sudo rm -R /var/.macadmin/Public /var/.macadmin/Sites


And finally Hide Users ID's < 500
sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool TRUE