Modifying Existing
User Information
You can modify the existing user
information by changing the passwords.
Home directory of a user, UIDs and GIDs, expiration dateof an account
and so on. Let’s discuss these features
in the followingsections.
Modification in the exisiting user
inofmation means as – a chane in the user’s password. Their home directory, expiration date of user
accout. User Identification (UID) and
Group Identification (GID). Let’s change
the home directory. UIDs, EIDsand accout expiration information of a user in
the following sections.
Changing the
User’s Home Directory
To change a user’s home
directory , you can run the following command:
#usermod –d
Similarly, if you want to cnage the Mahendra’s home directory from / home/Mahendra to/home/mahen, run the follwing
command:
#user mod-d /home/mahen Mahendra
To change Mahendra’s home directory along with the information that’s
contained in Mahendra’s home directory(home/Mahendra) to the new locatin (/home
/mahen). Run the following command:
#user –d -m /home h mahen
Mahendra
This command moves all files of the Mahendra’s current directory
(/home/Mahendra) to the new home directory (/home/mahen).
Changing UIDs and GIDs
In Linux every user have UID and GID.
The UID of a user is an interger value used to identify user within the
Linux system whereas the GID(an iterger value ) of a user represent a specific group to which the user
belong. If you want to change a user’s
UID. Run the following command:
#usermod -u -
The following
command changes Mahedra’s UID to 555:
#usermod –u 555 Mahendra
To change a user’s
GID, run the command:
#usermod –g -
The following
command changes Mahendra’s GID to 555:
#usermod –g 555
mahendra