If you need a temporary access on a system, you can set the expiry date of an account. The administrator can change the account expiration date so that the account is disabled on a set date. If you want to cange the account expiration date of a user, run thefollowing command:
#usermod –e MM –
DD-YYYY
In the preceeding
command MM-DD-YYYY represents the month,
day and year; two-digit year fields are also accepted.
Let’s take an
example where you want an account for user deven to be expired on March 1,
2010. You can use the following command for this purpose:
Usermod –e
03/01/10 deven
This command resets
the account expiration date for the ser deven t to Marc 1, 2010
Changing
Finger Information
If you want to
have the information about users on a system.
Youcan use the following finger command;
#finger
You can obtain the
user’s full name, office location, and phone number from the preceding finger
command. For example, to get the user
deven full name, terminal name. home directory type the finger command as
follows:
#finge – 1 deven
The proceeding
command prints the terminal name, home directory, mail status, home phone
number of the user deven.
The chfn command
is used to change a user’s finger information.
To change finger information for deven, type the chifn command as
follows:
#chfn deven
If you not
specified which information (whether Full name, Phone number or directory )You want to
change, you’ll be prompted for each field information for the user. At the prompt, you can enter the new
information. Or just press return to leave the field unchanged or enter the
keyword “ none” to make the field blank.
Deleting Users
The userdel
command is used to delelte a user account.
In order to delete previously created use, Mahedra, type the userdel
command as follows:
#userdel Manhedra
You can use an –r
option with userde. If you would like to
remove the user’s home directory also. Let’s summarize
the main points of the Lab.
Summary
In
this L ab. You learn to create, modify, delete, and disable user accounts using
command line tools in Unix environment.
You also learn to modifying Information of an existing user by changing
the home directory. UIDs and GIDS, account expiration datem and finger
information. Toward the end of the
chapter, you learn to delete user account.