The list of users, explained simply

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 student

In 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 root has 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 passwd with no name prints every account. Pipe it to less or grep when the list is long.

HOME LABS COMMUNITY DASHBOARD
Practice terminal Starting…