Linux is widely used in servers, cloud environments, and security-focused distributions like Kali Linux and Parrot OS. Understanding Linux security fundamentals is crucial for protecting systems against unauthorized access, malware, and cyberattacks.
This module covers the core security concepts and practices every Linux user and cybersecurity professional should know.
Linux is considered secure by design, but vulnerabilities can still exist. Security is important to:
Security in Linux involves user management, file permissions, firewalls, and regular system updates.
Proper user management ensures that only authorized users can access the system.
Create a new user:
sudo adduser john
Add user to a group:
sudo usermod -aG sudo john
Delete a user:
sudo deluser john
Strong password policies prevent unauthorized access.
Enforce password policies using /etc/login.defs:
PASS_MAX_DAYS – Maximum password agePASS_MIN_DAYS – Minimum password agePASS_WARN_AGE – Warning period before password expiresLinux uses permissions and ownership to protect files and directories.
Apply secure permissions to sensitive files:
chmod 700 /root/secret.txt
This gives full access to the owner only.
Audit file permissions regularly to prevent unauthorized access.
A firewall controls incoming and outgoing network traffic.
Linux supports multiple firewall tools, such as:
iptables – Advanced packet filteringufw – Simplified firewall managementfirewalld – Dynamic firewall for Red Hat-based systemsufw (Uncomplicated Firewall) simplifies firewall management.
Check status:
sudo ufw status
Enable firewall:
sudo ufw enable
Allow a service or port:
sudo ufw allow 22 # Allow SSH
sudo ufw allow 80 # Allow HTTP
Deny access:
sudo ufw deny 23 # Block Telnet
Delete a rule:
sudo ufw delete allow 80
Reset firewall to default:
sudo ufw reset
Students should now understand: