In Linux, user information is stored in the /etc/passwd file. Every line in /etc/passwd corresponds to exactly one user. When you first open /etc/passwd, you will see a lot of users, and you will wonder, where are all these users coming from? The answer is simple: most of these users are service users, and they are used by your system to start up various applications and services. However, our main focus of this chapter will be system users; those are real people like you and me!
Every line in /etc/passwd consists of 7 fields, each separated by a colon, and each field represents a user attribute. For example, the entry for user elliot will look something like this:
The following table breaks down those seven fields in /etc/passwd and explains each one of them:
Field |
What does it store? |
1 |
This field stores the username. |
2 |
This field usually has an X in it, which means the user's password is encrypted and... |