Linux Users and the /etc/passwd File Flashcards

1
Q

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

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.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

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.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

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.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The system maintains a database that…?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

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.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The /etc/passwd file is a …?

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Field 1 Username…?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Field 2 Password…?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Field 3 User Id (uid)…?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Field 4 Primary Groupid (gid)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Field 5 GECOS …?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Field 6 Home directory…?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Field 7 Login Shell…?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Modern Linux and Unix systems store passwords using….?

A

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
Q

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

A

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
Q

Type of User:

Normal User…?

A

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
Q

Type of User:

The root User…?

A

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
Q

Type of User:

The system user…?

A

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.