Linux Tutorial — Part 8: Users, Groups & sudo

Linux is built for multiple users. Understanding who can do what is essential for security, servers, and real production systems.

1. What Is a User in Linux?

A user represents an identity. Every process in Linux runs as some user.

2. Root User

root is the superuser. It can read, write, delete, and destroy anything.

3. Why sudo Exists

Running everything as root is dangerous. sudo allows temporary privilege escalation.

sudo apt update

4. Viewing Current User

whoami

5. Viewing All Users

cat /etc/passwd

6. Creating a New User

sudo useradd john

Create user with home directory:

sudo useradd -m john

7. Setting Password

sudo passwd john

8. Groups in Linux

Groups are collections of users. Permissions are often assigned to groups.

groups

9. Adding User to Group

sudo usermod -aG sudo john

10. Switching Users

su - john

Security Rule

Give sudo access only when required. Least privilege is a professional mindset.

Next: Package Management →
Disclaimer:
Incorrect user or sudo configuration can compromise system security.