nireport / /users name uid | grep "5[0123456789][0123456789]"This should report all users that are in the 500+ range for the user ID. User accounts generally start at 501, and work up, so look at the list returned, and pick the next available number to assign to the new user you are creating. You will use it in place of the uid 555 below.
The first line here will create the user, but then you need to assign it some properties. The user I am creating here has a shortname of "ftpuser". Feel free to substitute the shortname of your choice. Remember you can't reuse a shortname, so if there is already a user called "ftpuser", you need to pick something else. The home directory can really be anywhere, but we are using the standard location in this example. By assigning the /dev/null shell, we are preventing the user from logging in via SSH. The Mac OS X default shell is /bin/tcsh. There are other properties you can assign a user, but these are the basic ones that you should use.
sudo niutil -create / /users/ftpuser sudo niutil -createprop / /users/ftpuser uid 555 sudo niutil -createprop / /users/ftpuser realname "FTP User" sudo niutil -createprop / /users/ftpuser home "/Users/ftpuser" sudo niutil -createprop / /users/ftpuser shell "/dev/null" sudo niutil -createprop / /users/ftpuser gid 20 sudo niutil -createprop / /users/ftpuser passwd "*" sudo passwd ftpuserThen you will be prompted to enter the password you want to create for the new user. Optionally you can skip this step, and the account is created, but logins are disabled until the password has a value assigned.
The last step is to create the user's home directory. You could simply create the directory and give the user ownership of it, or use the lines below to copy the standard Mac OS X user template. This will create the standard set of directories and files for the new user.
sudo cp -R /System/Library/User\ Template/English.lproj /Users/ftpuser sudo chown -R ftpuser:staff /Users/ftpuserThis is basically what happens when you use the Accounts Preference Pane to create an account. Optionally you could SSH to another machine and create accounts.

