👥 Adding Users to Groups
Think of a Linux system as a big office building:
• Every user is like an employee who can log in, access certain rooms (files), and use office resources (programs).
• When someone new joins, you need to create a new employee account. When someone leaves, you delete their account.
1a. useradd
useradd is like the HR manager filling out a basic employee form: "Here's a new person. Give them an office and a username."
This creates a user john but doesn't create a home folder or set a password by default.
To create a home folder (so john has his own "desk").
To set a default shell (like giving the employee a preferred working tool).
1b. adduser
adduser is like a fancier HR assistant who asks for more details automatically: full name, password, phone extension.
This automatically:
- Creates a home folder /home/john → a
- Sets the shell to /bin/bash → b
- Prompts for a password → c
- Lets you fill in full name and other details → d
1c. userdel
When someone leaves the company, you need to remove their account:
By default, this removes the user account but keeps their files.
To remove the user and delete their home folder (desk and personal files).
Real-life analogy
useradd = fast basic signup, adduser = guided signup with forms and details.
✅ Key takeaway:
• useradd = basic account creation
• adduser = friendly guided creation
• userdel = removing users, -r removes their personal files too