Managing Local Linux Users and Groups
| Goal | To manage local linux users and groups and administer local password policies |
| Objectives |
|
| Sections |
|
| Lab | Managing Local Linux User and Groups |
Part 1: Users and Groups
Question: What is a User?
Every process (running program) on the system runs as a particular user. Every file is owned by a pariticular user. Access to files and directories are restricted by user. The user associated with a running process determines the files and directories accessible to that process.
[elewei@localhost Desktop]$id
The id command is used to show information about the current logged-in user.
[elewei@localhost Desktop]$ls -l /tmp
View the user associated with a file or directory. The third column shows the username
[elewei@localhost Desktop]$ps au
To view the process information, use the ps command. The default is to show only processes in the current shell. Add the a option to view all processes with a terminal.
To view the user associated with process, include the u option.
The mapping of names to numbers is defined in databases of account information. By default, systems use a simple "flat file" the /etc/passwd file, to store information about local users.
| username | password | UID | GID | GECOS: | /home/dir: | shell |
username: is a mapping of a UID to a name for the benefit of human users.
password: historically, passwords were kept in an ecrypted format. Today, they are stored in a separate file called /etc/shadow.
UID: is a number that identifies the user at the most fundamental level.
GID: the user's primary group ID number.
GECOS: is arbitrary text, which usually includes the user's real name.
/home/dir: is the location of the user's personal data and configuratoin files.
shell: a program that runs as the user logs in. For a regualr user, this is normally the program that provides the user's command line prompt.
Question: What is a group?
Like users, groups have a name and a number (GID). Local groups are defined in /etc/group.

浙公网安备 33010602011771号