Managing users
The user in a Linux system is defined by a set of three files:
/etc/passwd
: This file contains information about the user – that is, the user’s name, unique numerical ID (UID) in the system, the primary group the user belongs to GID, the path to the home directory, and the shell that is loaded when the user logs in. A typical entry looks like this:
admin:x:1000:1000:Debian:/home/admin:/bin/bash
Each line describes exactly one user. Fields are separated by a colon. The second field will only contain anything other than x
in very exotic cases. Here, x
means that the password is stored separately in the /etc/shadow
file. The reason is that permissions for the /etc/passwd
file have to be a bit more relaxed so that the login process can work. /etc/shadow
can only be read by root and root group and written to only by root:
root@myhome:~# ls -ahl /etc/passwd -rw-r--r-- 1 root...