Linux Users and the /etc/passwd File Flashcards Preview

Networking > Linux Users and the /etc/passwd File > Flashcards

Flashcards in Linux Users and the /etc/passwd File Deck (20):
1

When using a Linux system, you first identify yourself by logging on with a ...?

particular username (your username represents you. Your username is associated with the things that you do: every process that runs on the system has an associated username. Your username is associated with the things that you save: every file on the system is labeled as owned by a particular username. Your username is associated with the things that you use: the amount of disk space that you use, or the amount of processor time that you use, can be tracked by username.)

2

Not only does every user on the system have a unique username, but they normally have a unique...?

userid, often abbreviated uid. (Linux tracks userids as 32bit integer, meaning that there can be up to 2^32, or about 4 billion, distinct users.)

3

While people like to think in the terms of words (usernames), the Linux Kernal finds it simpler to think in terms of...?

numbers (uids). (when the kernel keeps track of who owns a process, or who owns a file, it remembers the uid instead of the username. Only when some command produces output for people to read does the uid get convert into a username.)

4

The system maintains a database that...?

maps usernames to userids. (The database is stored in the /etc/passwd configuration file.)

5

Linux, like Unix, has a fortunate tradition: even the core configuration files on the system are maintated in...?

human readable text, and editable by a text editor. Users, and most administrators, can use simple tools for handling text, such as pagers, to examine the database. Most users on the system have permission to read, but not modify, this file.)

6

The /etc/passwd file is a ...?

line based configuration file, where each line defines a single user on the system. Lines are internally broken down into seven fields, with each filed separated by a colon.

7

Field 1 Username...?

The username is used to give a human readable name to the user.

8

Field 2 Password...?

On older Unix systems, this field contains the user's encrypted password. By default, Red Hat Enterprise Linux does not make user of this field, for security reasons.

9

Field 3 User Id (uid)...?

The integer that the Linux kernel uses to identify the user.

10

Field 4 Primary Groupid (gid)

The integer that the Linux kernel uses to identify the user's primary group. Group memberships are discussed in the next lesson.

11

Field 5 GECOS ...?

This oddly named file no longer serves its original purpose, which was relevant to Unix's original development environment. These days, the filed is used to store simple text that helps identify the user, usually just a full name, but sometimes including a phone number or office address as well.

12

Field 6 Home directory...?

When a User logs in, his login shell will use this as its current working directory. It's one of the few directories that standard users can write in, and it's usually private to the user.

13

Field 7 Login Shell...?

The login shell is the user's default shell when they login. In Red Hat Enterprise Linux, it is usually /bin/bash

14

Users seldom, if ever, modify this file directly, although...?

several commands will be introduced that allow users to change certain fields. If you ever need to refresh your memory, the fields are documented in the passwd(5) man page.

15

A user's encrypted password used to be stored in the second field of the /etc/passwd file. Because the /etc/passwd file contains..?

much more information than just passwords, everyone needs to be able to read it. With modern computer power, however, even exposing the encrypted form of your password is dangerous. Without too much effort, modern machines can try to figure out your password by encrypting every combination of every letter until a match is found. This is known as a "brute" force" attack.

16

Modern Linux and Unix systems store passwords using....?

a newer technique called "Shadow Passwords", where users' passwords are stored in a dedicated /etc/shadow file. Because this file contains only password related information. its permissions do not allow people to view its contents.

17

Users can change their password with a simple command called...?

passwd. (If you are not the user root, the passwd command takes no arguments, and accepts no command line switches. Its single use is to allow a user to change her own password)

18

Type of User:
Normal User...?

Normal users represent real people who use the system. Normal users usually have /bin/bash as a login shell, and a home directory within the /home directory. Generally, normal users may create files only within their home directories and system wide temporary directories, such as /tmp and /var/tmp. In Red Hat Enterprise Linux, normal users usually have uids greater than 500.

19

Type of User:
The root User...?

The uid 0 is reserved for the user root, sometimes called the superuser. The root user has a free reign on the system: she may modify or remove any file; she may run any command; she may kill any process. The root user is in charge of adding and maintaining other users, configuring hardware, and adding system software. Although the root user may create files anywhere on the system, she usually uses /root as her home directory.

20

Type of User:
The system user...?

Most Linux systems reserve a range of low valued uids to act as system users. System users don't represent people, but components of the system. For example, the processes that handle email often run as the username mail. The processes that run the Apache web server run as the user apache. System users usually do not have a login shell, because they don't represent people who actually log in. Likewise, the home directories of system users seldom reside in /home, but are usually system directories that pertain to the relevant application. For example, the user apache has a home directory of /var/www. In Red Hat Enterprise Linux, system users have uids ranging from 1 - 499.