How to List Users in Ubuntu

The Security Audit Vector

When inheriting the administration of a legacy Ubuntu server, blindly assuming you are the only authorized entity is a catastrophic security failure. Over years of operation, previous administrators may have instantiated dozens of rogue accounts, dormant FTP users, or hidden backdoors disguised as system daemons. Before you deploy sensitive enterprise data, you must execute a strict cryptographic interrogation, commanding the Linux kernel to output a complete, mathematically exhaustive list of every single user identity currently registered within the core `/etc/passwd` database.

How to List Users in Ubuntu

Ubuntu does not utilize a graphical “User Manager” on headless servers. You must utilize command-line utilities to directly parse the master authentication registry or query the highly structured `getent` database.

1. Open your terminal application or connect to the server via SSH.
2. Method 1: The Raw Database Interrogation (`cat /etc/passwd`):
* The `/etc/passwd` file is the absolute source of truth for all local user accounts. The `cat` command reads this file and dumps its raw contents instantly to the terminal.
* Type exactly:

cat /etc/passwd

* Press Enter.
* The terminal will output a massive, chaotic matrix of text. Every single line represents one user. The very first string of text on each line (before the first colon `:`) is the exact username.
* The Noise Problem: This list includes dozens of hidden system users (like `syslog`, `www-data`, `nobody`) that the kernel uses to run background services. Identifying actual human users is difficult.
3. Method 2: The Filtered Interrogation (Finding Human Users):
* To filter out the system noise, you must understand Ubuntu’s cryptographic numbering system. Human users are mathematically assigned a User ID (UID) of 1000 or higher.
* We can use the `awk` utility to parse the database and only output users whose UID is >= 1000.
* Type exactly:

awk -F: '$3 >= 1000 {print $1}' /etc/passwd

* Press Enter.
* The terminal will output a clean, highly readable list containing only the actual human user accounts installed on the server.
4. Method 3: The Universal Database Query (`getent passwd`):
* If your Ubuntu server is connected to a massive corporate network using LDAP (Lightweight Directory Access Protocol), the local `/etc/passwd` file is incomplete. It will not show the remote corporate users.
* You must instruct the server to query all available authentication databases simultaneously.
* Type exactly: getent passwd
* This outputs the absolute total list of every identity authorized to interact with the silicon.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.