Search This Blog

Friday, February 26, 2010

Adding users from the command line in Snow Leopard


This is just a quick tutorial on how to add users from the command line in snow leopard. This command will also work in previous versions of os x. The following commands need to be run as root or with the sudo command.


Creating a new user

dscl / -create /Users/bsdjedi

Create a new user and set the default shell for that user

dscl / -create /Users/bsdjedi UserShell /bin/ksh

Creating a new user and setting the uid as well

dscl / -create /Users/bsdjedi UniqueID 800

Setting the password when creating a user

dscl / -create /Users/bsdjedi PASSWORD

or you can use the tradition unix way and run the following:

passwd bsdjedi


If you would like to give a user admin right run the following command

dscl / -append /Groups/admin GroupMembership bsdjedi


This concludes my tutorial on add users in snow leopard ( os x ) from the command line if need more information just do a man dscl. :)

No comments: