🌸 Initial commit — Midori's Linux Dojo

This commit is contained in:
mrsh
2026-05-22 01:59:08 +02:00
commit 9bee8dac3e
7 changed files with 574 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
# 🧰 Phase 3: Users and Files
> Goal: Who can do what — users, groups, permissions, processes
---
## 🎯 Exercise 1 — User Management
```bash
# Create users
useradd -m bob
passwd bob # Set a password
# Check user info
id bob
cat /etc/passwd | grep bob
# Groups
groupadd developers
usermod -aG developers bob
groups bob
# Switch user
su - bob
whoami
exit
```
---
## 🎯 Exercise 2 — File Ownership
```bash
# Create file as root, give to bob
touch /root/lab/team-project.txt
chown bob:developers /root/lab/team-project.txt
ls -la /root/lab/team-project.txt
# Set permissions
chmod 640 /root/lab/team-project.txt
```
---
## 🎯 Exercise 3 — Sudo / Doas
```bash
# Give bob sudo access
echo "bob ALL=(ALL) ALL" >> /etc/sudoers
# OR on Alpine (doas):
echo "permit persist bob" >> /etc/doas.d/doas.conf
```
---
## 🎯 Exercise 4 — Processes
```bash
# View processes
ps aux
ps -ef
top # Press 'q' to quit
# Background jobs
sleep 100 &
jobs
kill %1
# Service management (Alpine)
rc-service sshd status
rc-update show
```
---
## ✅ Phase 3 Checklist
- [ ] Create users and groups
- [ ] File ownership and permissions
- [ ] Sudo/doas configuration
- [ ] Process management
**Previous:** [[Phase 2 - Networking]] | **Next:** [[Phase 4 - Security]]