Linux Users and the /etc/passwd File Flashcards
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.)
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.)
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.)
The system maintains a database that…?
maps usernames to userids. (The database is stored in the /etc/passwd configuration file.)
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.)
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.
Field 1 Username…?
The username is used to give a human readable name to the user.
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.
Field 3 User Id (uid)…?
The integer that the Linux kernel uses to identify the user.
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.
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.
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.
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
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.
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.