(old post but) dscl for
non-Mac OS X
Server was added in 10.5, so for anyone with Tiger or prior, we would need to use other means such as
niutil.
passwd shortname
may work, replace shortname with your short name and give the new one.
Otherwise, create a new admin user and log in as that, then change the previous account's password.
So, for Mac OS X 10.4
non-Server
niutil -create . /users/fred
niutil -createprop . /users/fred gid [groupID]
niutil -createprop . /users/fred uid [uniqueNumberOver1000]
niutil -createprop . /users/fred shell /bin/tcsh
niutil -createprop . /users/fred home /Users/fred
niutil -createprop . /users/fred realname "fred jones"
niutil -createprop . /users/fred passwd '*'
mkdir /Users/fred
mkdir /Users/fred/.ssh
chown -R fred /Users/fred
chgrp -R [groupID] /Users/fred
chmod 755 /Users/fred
should do it. Replace all details with the other relevant details. The uid for first created user is 501, so don't specify that or make sure the uid you give isn't in use yet.