Stage 4 · Lesson 2 of 8
Users, groups, root and sudo
is built for many on one machine. Each user has an ID number and belongs to one or more ; id shows yours. The root user, also called the superuser, can do anything.
So you work as a normal user and put sudo in front of single commands that need more power, such as installing packages. chown changes who owns a file. You usually need it after creating something with sudo by mistake. Adding a user to a group, such as docker, gives them that group's access.
Common traprunning everything with sudo, including npm install or commands, which leaves root-owned files in your home that later fail with "permission denied".
A question to check yourself, an AI practice session and 2 cheat sheet entries come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- BookFreeThe Linux Command Line
William Shotts · Beginner
Its chapters on permissions and processes are the clearest free explanation of this stage
- GuideFreeThe Linux Command Line for Beginners (Ubuntu)
Canonical · Beginner
Includes a short, careful section on the superuser and when to use sudo
Practise
Keep handy
Also worth your time
- roadmap.sh: LinuxGo deeper
See the users, permissions and process management branches of the Linux map