Modifying a User Account

You can change the value of an attribute in a user account by using dscl.

There are many attributes that can be set for users. The following table describes some of the user account attributes you can modify using dscl:

Attribute

Description

apple-generateduid

User id generated by the system.

 

 

cn

User’s common name.

 

 

homeDirectory

Location of the user’s Home Folder.

 

 

loginShell

User’sTerminal shell.

 

 

sn

User’s sir name.

 

 

LastName

User’s last name.

 

 

NFSHomeDirectory

Location of the user’s Home Folder.

 

 

PasswordPlus

User’s password.

 

 

PrimaryGroupID

User’s primary group ID.

 

 

RealName

User’s name.

 

 

UserShell

User’sTerminal shell.

 

 

To change a user account attribute to a new value:

1Start the dscl tool in interactive mode, specifying the computer you are using as the source of directory service data:

$ dscl localhost

>

2Change the current folder to /LDAPv3/ipaddress/Users by entering the path at the prompt:

> cd /LDAPv3/ipaddress/Users

Replace ipaddress with the IP address of your directory server. If using a NetInfo directory domain, enter cd /NetInfo/root/Users at the prompt.

3Authenticate as an administrator by entering the following command, replacing adminusername with your administrator user name, and entering your administrator password when prompted:

> auth adminusername

4Set the user attribute to the desired value by entering the following command, replacing ajohnson with the user account’s short name, attribute with the name of the attribute whose value you wish to change, and newvalue with the value:

> create ajohnson attribute newvalue

5Quit dscl by entering:

> quit

Chapter 8 Working with Users and Groups

107

Page 107
Image 107
Apple Mac OS X Server Modifying a User Account, To change a user account attribute to a new value, Attribute Description