Module 64: Linux Commands

Lesson 2 of 5 · 15–25 minutes

Users and groups

🏠The everyday picture

A school has teachers, students and office staff. Each person has their own login and locker; groups (Class 8, the staff room) share some rooms and cupboards.

📘What it really is

🖱️Try it

Create a user deploy and a group crm. Add deploy to crm. Switch to the new user with sudo -iu deploy, run id, and try sudo apt update (it should be refused, since deploy isn't in the sudo group). Exit back.

✅Quick check

Why do services like Nginx run as their own users?

Show the answer

So a flaw in one service can only reach what that user can, not the whole system.

Should you sign in as root for everyday work?

Show the answer

No. Use your own user and sudo only when needed.

← PreviousWorking with files
ProLearners Assist