# For OS X 10.6.7 call "bash thisscript.sh" dscl . -create /Users/postgres dscl . -create /Users/postgres UserShell /bin/bash dscl . -create /Users/postgres RealName "Postgres Administrator" dscl . -create /Users/postgres UniqueID 520 dscl . -create /Users/postgres PrimaryGroupID 1000 dscl . -passwd /Users/postgres MyCoolPostgresPassword # dscl . -append /Groups/admin GroupMembership postgres