Skip to content

Instantly share code, notes, and snippets.

@NeoHBz
Created June 19, 2024 10:26
Show Gist options
  • Save NeoHBz/519fb4d8b7490be139a7e84b2a9fd646 to your computer and use it in GitHub Desktop.
Save NeoHBz/519fb4d8b7490be139a7e84b2a9fd646 to your computer and use it in GitHub Desktop.
MacOS: Create new user without homedir/login
sudo dscl . -create /Users/unbound
sudo dscl . -create /Users/unbound UserShell /usr/bin/false
sudo dscl . -create /Users/unbound RealName "Unbound DNS User"
sudo dscl . -create /Users/unbound UniqueID "550"
sudo dscl . -create /Users/unbound PrimaryGroupID 20
sudo dscl . -create /Users/unbound NFSHomeDirectory /var/empty
sudo dscl . -passwd /Users/unbound "password"
sudo dscl . -append /Groups/_developer GroupMembership unbound
# dscl . -list /Groups PrimaryGroupID
# 20 for staff (standard users)
# 80 for admin (administrators)
# 0 for wheel (superuser group)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment