โ† Linux Administration
๐Ÿง Linux Admin

Common Issues in Linux Administration โ€” Part 1

The five most frequent problems in production Linux environments โ€” disk space, CPU/memory, networking, services, and permissions โ€” each with the exact commands to fix them.

โ„น๏ธ
Applies to: RHEL, CentOS, Ubuntu, Debian, and most systemd-based Linux distributions. Commands may vary slightly by distro.
Disk Space Full โ€” No space left on device

Check which filesystem is full, then find the largest consumers and clean them up.

df -h                           # show all filesystems
du -sh /var/log/* | sort -rh    # find largest log dirs
find / -size +500M 2>/dev/null  # find files over 500 MB
journalctl --vacuum-size=500M   # trim systemd journal

High CPU / Memory Usage

Identify and handle runaway processes. Check for memory leaks causing OOM kills.

top                          # interactive process viewer
ps aux --sort=-%cpu | head   # top CPU consumers
ps aux --sort=-%mem | head   # top memory consumers
kill -9 <PID>              # force-kill a process

# Check for OOM kills:
dmesg | grep -i 'oom\|killed'

Network Connectivity Issues

Diagnose from layer 3 upward โ€” IP config, routing, DNS, then application-level connectivity.

ip addr show                    # check IP configuration
ping -c 4 8.8.8.8               # test internet reachability
dig google.com                   # test DNS resolution
ss -tulnp                        # check listening ports
systemctl restart NetworkManager # restart network service

Service Startup Failures

Services fail silently โ€” always check systemd status and journal for the real error.

systemctl status <service>      # brief status + last lines
journalctl -xeu <service>      # full logs for the service
systemctl restart <service>    # attempt restart
systemctl enable <service>     # enable on boot

File Permission Problems

Permission denied errors โ€” identify ownership and fix at the right level.

ls -la /path/to/file             # check current permissions
chmod 755 /path/to/file          # set rwxr-xr-x
chown user:group /path/to/file   # change owner
getenforce                        # check SELinux mode
# If SELinux is enforcing:
restorecon -Rv /path/to/dir      # restore default context
๐Ÿ’ก
Continue reading: Part 2 covers issues 6โ€“10: user auth failures, package errors, kernel panics, SELinux denials, and NTP sync.