P. 1
Linux Certification Bible

Linux Certification Bible

4.0

|Views: 2.327|Likes:
Publicado porMarcelo

More info:

Published by: Marcelo on Dec 18, 2008
Direitos Autorais:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

01/17/2013

pdf

text

original

4.2 Modify existing users (e.g., password, groups, personal information)

You can change user information by using several tools. The tools that are most
often used are chfn, chsh, and usermod. Linux administrators use these commands
to provide basic user management in the Linux environment.

The usermodcommand

The usermodcommand is the command most often used to administer user
accounts. This command uses the -c, -d, -e, -f, -g, -p, -s, and -u options that were
shown previously in Table 9-1 and the following options shown in Table 9-2.

Table 9-2

Options for usermod

Option

Description

-l

Changes only the users account name to . This
does not change the home directory of the user.

-L

Locks the users password, effectively disabling the password.

-U

Unlocks the users password, reverses the -L option.

--help

Provides program help.

144881-6 ch09.F 11/12/01 8:30 AM Page 295

296Part IV ✦Administration

The usermodcommand provides access to not only the settings available when cre-
ating an account, but also to the settings for changing an account name and locking
and unlocking an account. These settings make the usermodcommand an excellent
tool for basic administration of the user account.

The chfncommand

Another tool that is often used to provide basic user account administration is
chfn. The chfncommand is used to change the fingerinformation provided by
the /etc/passwdfile. This file provides four fields that are displayed when the
fingercommand is used to identify a user.

Use the fingercommand to gather information based on a user name. The com-
mand can accept user names and return real information about that user.

The Linux fingercommand displays four pieces of information: full name, loca-
tion, work phone, and home phone. This information can be useful to identify users
by using the fingercommand. The command employs options to assign this infor-
mation, as shown in Table 9-3.

Table 9-3

Options for chfn

Option

Description

-f

Assigns the full name of the user.

-o

Allows the assignment of the location or office room.

-p

Assigns the office phone number.

-h

Assigns the home phone number.

-v

Prints version information.

-u

Prints usage message.

--help

Provides program help.

The chfncommand allows administrators to provide basic real world information
about a user to the fingercommand.

144881-6 ch09.F 11/12/01 8:30 AM Page 296

297

Chapter 9 ✦General Linux Administration

The chsh command

Use the change shell command, or chsh, to change a user’s default shell only. This
allows only the shell to be changed and uses the options shown in Table 9-4.

Table 9-4

Options for chfn

Option

Description

-s

Specifies the login shell.

-l

Lists the available shells in /etc/shells.

-v

Prints version information.

-u

Prints usage message.

--help

Provides program help.

You're Reading a Free Preview

Descarregar
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->