User Management Files

The user system in Unix allows different people to log in to the same machine without interfering with one another. At the lowest level, users are nothing more than numbers (user IDs), but login names help to avert confusion and boredom.

The plain-text file /etc/passwd maps login names to user IDs, and it looks something like this:

juser:x:3119:1000:J. Random User:/home/juser:/bin/bash
beazley:x:143:1000:David Beazley:/home/beazley:/bin/bash

The format is straightforward. Each line represents one user, with seven fields separated by colons:

  • The user (login) ...

Get How Linux Works now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.