Module 3 · Linux and Windows Administration · Lesson 7 of 75
Linux administration for security
The Linux file system, users and groups, permissions, sudo, packages, services and the logs that matter, practised in a live terminal.
In this lesson · about 40 minutes
- Find your way around the Linux file system and its key security files
- Read and set permissions, and use sudo safely
- Manage packages and services, and read authentication logs
Where things live
| Path | What is there | Security interest |
|---|---|---|
/etc | System settings | /etc/passwd (accounts), /etc/shadow (password hashes, root-only), /etc/sudoers, /etc/ssh/sshd_config |
/var/log | Logs | auth.log or secure (logins, sudo), syslog, web server logs |
/home | Users' files | ~/.ssh/authorized_keys, ~/.bash_history |
/root | The root user's home | Should only be readable by root |
/tmp, /dev/shm | Temporary files, writable by everyone | A favourite place for attackers to drop tools |
/bin, /usr/bin, /sbin | Programs | Replaced binaries are a sign of a rootkit |
/etc/cron*, /etc/systemd/system | Scheduled jobs and services | Common persistence locations |
Users, groups and sudo
- Every account has a line in
/etc/passwd:alice:x:1001:1001:Alice:/home/alice:/bin/bash(name, password placeholder, user ID, group ID, comment, home, shell). UID 0 is root: any account with UID 0 is all-powerful, whatever its name. - Create and manage accounts with
sudo useradd -m -s /bin/bash alice,sudo passwd alice,sudo usermod -aG sudo alice(add to the sudo group),sudo usermod -L alice(lock). sudoruns one command as root and logs it. Check who can use it withsudo -landgetent group sudo. Lines withNOPASSWDin/etc/sudoersdeserve a hard look.
Permissions
ls -l shows -rwxr-x---: the file type, then read/write/execute for the owner, the group and others. In numbers, r = 4, w = 2, x = 1, so rwxr-x--- = 750. Sensible defaults: 644 for normal files, 600 for private keys and secrets, 755 for programs and folders. Two special bits to watch: SUID (the program runs as its owner, often root; find them with find / -perm -4000 2>/dev/null) and world-writable files (find / -perm -o+w -type f). Both are classic privilege-escalation paths (Module 14).
Packages and services
- Debian/Ubuntu/Kali:
sudo apt update && sudo apt upgrade. Red Hat family:sudo dnf upgrade. - Services:
systemctl status ssh,sudo systemctl stop|start|restart|enable|disable nginx,systemctl list-units --type=service --state=running. - Logs:
journalctl -u ssh --since today,sudo tail -f /var/log/auth.log,last(recent logins),lastb(failed ones).
Try it · watch it happen
Permission builder: who may do what
Tick the boxes to build a permission set and watch the number and the rwx string change together. Try to make 600, 644, 750 and 755.
| 👀 Read (4) | ✏️ Write (2) | ▶️ Execute (1) | Adds up to | |
|---|---|---|---|---|
| Ownerlearner | 4 + 2 + 0 = 6 | |||
| Grouplearner2 (in labgroup) | 4 + 2 + 0 = 6 | |||
| Othersguest (everyone else) | 4 + 0 + 0 = 4 |
🧑 learner
✓ can open and read it
✓ can change it
✗ can run it as a program
👥 learner2 (in labgroup)
✓ can open and read it
✓ can change it
✗ can run it as a program
🌍 guest (everyone else)
✓ can open and read it
✗ can change it
✗ can run it as a program
Doors along the way: can learner2 reach /home/learner/lab/notes.txt?
To open a file you must pass through every folder before it. A folder's x permission is its door.
Try it · watch it happen
Users wear group badges
Add people to groups and see who can open which files. Notice how a group lets you give access to a team without touching each file.
On the system (the official list)
learner2
Their open terminal (snapshot from login)
Practice terminal · missions
Lab: a quick security check of a Linux box
You are Sam on a small practice server. Work through the missions; the picture on the right shows the files and processes as you go. Type help to see the commands this practice terminal knows.
Missions 0 of 8
- 1Confirm which account you are using.
- 2List your home folder with details and hidden files.
- 3Try to read the system log /var/log/syslog as Sam.
- 4Read it again as administrator, keeping only the sshd lines.
- 5List every process on the machine.
- 6It is Sam's own runaway report job (PID 3150). Stop it politely.
- 7Make notes.txt readable and writable by Sam only, using numbers.
- 8Find files bigger than 10 MB in your home folder.
Type a command and press Enter. Try help to list commands. Tab finishes names, ↑ repeats.
- ~ (/home/sam)you are here
- documents
- budget-2026.csv
- letters
- thank-you.txt
- meeting-notes.txt
- resume.pdf
- downloads
- installer.zip
- report-final-v2.pdf
- report-final.pdf
- logs
- access.log
- app.log
- old
- app-2026-09.log
- app-2026-10.log
- notes.txt
- photos
- beach.jpg
- cat.png
- trip
- day1.jpg
- day2.jpg
- projects
- website
- index.html
- style.css
- scripts
- backup.sh
- hello.shruns
- todo.md
This picture updates as you type. Changed items flash. runs = executable, a name badge = owned by someone else.
Check your understanding0 of 4 correct
Quiz score: 0 of 4
Written by Noviq Academy in its own words. All labs are simulations: no real systems are touched, and every name, address, password and hash is made up. The offensive techniques taught here are for defending systems and for authorised testing only; never scan, access or test a system without the owner's written permission. Tool and product names belong to their owners, and command output may differ slightly from yours. Read-aloud uses your device's built-in voices.