Every account lives in one file
Linux keeps the list of accounts in a plain text file, /etc/passwd. Each line is one account, and the pieces are separated by colons (:). Let's look at two of them:
getent passwd root
getent passwd studentIn the terminal
student@vulntech:~$ getent passwd root root:x:0:0:root:/root:/bin/bash student@vulntech:~$ getent passwd student student:x:1000:1000:Student:/home/student:/bin/bash
Reading left to right, the first field is the name and the third field is the user ID number (UID). The UID is the important one. The rule is simple:
- UID 0 means superuser — total control of the machine. Normally only
roothas it. - Normal people have a high number (1000 and up), like
student. - Low numbers below 1000 are built-in system accounts for services.
Tip:
getent passwdwith no name prints every account. Pipe it tolessorgrepwhen the list is long.