← Back to All Articles
Homeβ€ΊArticlesβ€ΊLinux

Linux Security Fundamentals: Permissions, Hardening & Auditing

Essential guide to securing Linux systems, managing file permissions, auditing logs, and service hardening.

β€’β€’β€’

# Introduction to Linux Security

Linux powers the majority of cloud servers, containers, supercomputers, and security appliances worldwide. Securing Linux requires a disciplined approach across file permissions, service privileges, authentication, and network exposures.

# File Permissions & Ownership

Linux uses a standard discretionary access control model: Read (4), Write (2), Execute (1) applied to Owner, Group, and Others.

Securing Sensitive Files with chmod and chown
# Set read/write for root only on shadow password file
chmod 600 /etc/shadow
chown root:root /etc/shadow

# Ensure authorized_keys has restricted permissions
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh

# SSH Hardening

Disable root login, enforce key-based authentication, and disable legacy password authentication in /etc/ssh/sshd_config.

⚠️Critical SSH Settings

Ensure 'PermitRootLogin no' and 'PasswordAuthentication no' are configured in production environments.

# UFW & Firewall Configuration

Block all unsolicited inbound traffic by default and permit only necessary ports.

# Auditing & Log Monitoring

Inspect auth.log, journalctl, and auditd logs regularly to detect brute-force attempts and privilege escalation anomalies.