Every account on a Linux computer has a name and a number, the user ID (UID). People use the name. The kernel uses the number.
/etc/passwd
/etc/passwd lists every account, one line for each. Fields are separated by ::
learner@tidepool:~$ grep ana /etc/passwd
ana:x:1001:1001:ana:/home/ana:/bin/bashThe x means that the password is not in this file. Any account can read /etc/passwd. The passwords are in a file that only root can read.
Three kinds of account
| User ID | Kind | Example |
|---|---|---|
| 0 | The administrator | root |
| 1 to 999 | System accounts: a program runs as them | syslog, www-data |
| 1000 and up | People | learner, ana |
In "Parent and Child Processes", the UID column of ps -ef showed root, syslog and learner. Each process runs as an account. A program that runs in the background often has its own system account.
No login for system accounts
A system account usually has the shell /usr/sbin/nologin. This program refuses the login, so nobody can log in with that account:
till:x:998:998::/nonexistent:/usr/sbin/nologin