Progress: 0/62 (0%)
🛡️ Using sudo for Administrative Tasks
Using sudo for Administrative Tasks
Think of sudo as a temporary master key that lets you perform actions regular users aren't allowed to do, like changing system files or installing software.
Think of sudo as a temporary master key that lets you perform actions regular users aren't allowed to do, like changing system files or installing software.
4.1 What sudo Does
- sudo → = "superuser do"
- Lets you run commands as root (the system administrator) →
- Keeps your system secure by not giving full-time root access to regular users →
sudo apt update
- Updates the package list →
- Normally, a regular user cannot do this →
- Using sudo temporarily elevates privileges →
4.2 Running Commands with Elevated Privileges
Prefix any command that requires admin rights with sudo:
sudo mkdir /opt/newfolder
sudo rm -rf /var/log/oldlogs
- First command creates a system folder →
- Second command deletes old logs (be careful!) →
4.3 Safety Tips
- Use sudo sparingly – Think before you execute, since mistakes can affect the whole system.
- Don't stay logged in as root – Only use sudo when needed.
- Check command before pressing Enter – Especially destructive commands like rm -rf .
Real-life analogy
Next up will be Topic 5: Managing Access Control Lists (ACLs), which allows more fine-grained permission control beyond basic rwx.