Users, Permissions, Security, and Remote Access
Objective: Understand how Linux handles users, groups, file permissions, firewalls, SSH, and remote file transfer.
In the real world, you don't log in as root. Systems have users. Users have permissions. If you don't understand this, you'll either lock yourself out or leave the door wide open.
Most IT work is done remotely: you won't be sitting in front of the server. You'll be SSH'd in from somewhere else, transferring files, managing configs, and troubleshooting from a terminal connected over a network.
File permissions: Read (r), write (w), execute (x). Octal notation: 755 means owner rwx, group r-x, others r-x.
SSH key pairs: Public key goes on the server, private key stays on your machine. The private key never leaves. Ever.
sshd_config: Server-side SSH config. Disable password auth, restrict which users can connect.
UFW: Beginner-friendly layer over iptables. Manages chains (INPUT, OUTPUT, FORWARD).
SCP: Simple one-off file transfers over SSH
SFTP: Interactive file transfer session over SSH. Like FTP but encrypted.
rsync: Power tool. Synchronizes files between machines. Only transfers what changed. Use for backups.
Principle of least privilege: Every account and process gets the minimum permissions needed. Nothing more.
ssh-keygen -t ed25519Generate a key pair (ed25519 is the modern standard)ssh-copy-id user@hostCopy your public key to a remote machinessh user@hostConnect to a remote machinesudo ufw enableTurn on the firewallsudo ufw default deny incomingBlock all incoming by defaultsudo ufw allow 22/tcpAllow SSHsudo ufw allow from 192.168.1.0/24 to any port 22Allow SSH from local subnet onlysudo ufw status verboseSee all active rulessudo iptables -L -v -nList all iptables rulesscp file.txt user@host:/path/Copy a file to remotersync -avz ./folder/ user@host:/backup/Sync folder with compression- 1
Create three new users: admin1, dev1, and intern1.
- 2
Create a group called devteam. Add admin1 and dev1 to it.
- 3
Create /opt/project so devteam can read and write. intern1 has read-only access. Verify with ls -la.
- 4
Generate an Ed25519 key pair with a passphrase. Disable password authentication in sshd_config. Connect to your machine via key.
- 5
Create an SSH config entry for your machine so you can connect with a short alias instead of the full command.
- 6
Configure UFW: default deny incoming, allow outgoing. Allow SSH from your local subnet only. Allow HTTP (80) from anywhere.
- 7
Run sudo iptables -L -v -n. Document what you see. Identify which rules UFW created.
- 8
Use SCP to copy a file to /tmp on localhost. Use rsync to sync course-notes/ to /tmp/course-backup/. Run it twice. Notice the second run transfers almost nothing.
- 9
Write a brief explanation of what the principle of least privilege means and why it matters. Your own words.