Creating Mac OS X 10.5 System Accounts

08/15/2009

by Ron Valente

Introduction

With the upcoming release of leopard there are many changes under the hood. One of the small but quite annoying changes if you are used to the old ways is the removal of the NetInfo manager application. This is a blessing in disguise because the new implementation of user creation and account management.

Create the users home directory

sudo mkdir -p /Users/USER

Creating the users primary group

sudo dscl . -create /Groups/USER
sudo dscl . -create /Groups/USER PrimaryGroupID UID

Creating the user and setting options

sudo dscl . -create /Users/USER
sudo dscl . -create /Users/USER RealName "USER FULL NAME"
sudo dscl . -create /Users/USER NFSHomeDirectory /Users/USER
sudo dscl . -create /Users/USER UserShell /bin/SHELL
sudo dscl . -create /Users/USER UniqueID UID
sudo dscl . -create /Users/USER PrimaryGroupID UID`

Setting the users passwd

passwd USER

Adding users to a secondary group

sudo dscl . -append /Groups/OTHERGROUP GroupMembership USER

Set the ownership of the users home directory to the users home dir

sudo chown -R USER:GROUP /Users/USER
Tags: mac, 10.5, account, user
blog comments powered by Disqus