Specifications

108 Chapter 8 Managing User and Group Accounts
To test a user’s password:
$ sudo /System/Library/ServerSetup/serversetup -verifyNamePassword
shortname
password
The command displays a 1 if the password is good, or a 0 if it isn’t.
To view names associated with a UID:
$ sudo /System/Library/ServerSetup/serversetup -getNamesByID
uid
If you don’t receive a response, the UID is not valid.
To get the default UNIX short name for a user long name:
$ sudo /System/Library/ServerSetup/serversetup -getUNIXName "
longname
"
Note: Mac OS X Server provides the net tool, which is essentially a clone of the
Windows
net command. The net tool enables administrators to perform advanced
customization of the Primary Domain Controller (PDC) and mapping domain privileges
to UNIX groups. For more information, see the net man page.
Modifying a User Account
You can change the value of an attribute in a user account by using dscl.
You can set or modify the following user account attributes using dscl:
Attribute Description
apple-GeneratedUID User ID generated by the system
cn Users common name
homeDirectory Location of the user’s Home folder
loginShell Users Terminal shell
sn Users surname name
LastName Users last name
NFSHomeDirectory Location of the user’s Home folder
PasswordPlus Users password
PrimaryGroupID Users primary group ID
RealName Users name
UserShell Users Terminal shell