Lesson 13 — Linux Administration & Troubleshooting
Lesson 13 — Linux Administration & Troubleshooting
Section titled “Lesson 13 — Linux Administration & Troubleshooting”Lesson Overview
Section titled “Lesson Overview”In a production environment, Linux administrators rarely spend all day installing software or creating users.
Instead, much of their time is spent solving problems.
Imagine receiving alerts like these:
- Website is down
- Server is running slowly
- Users cannot log in
- Disk space is full
- Application won’t start
- Database connection failed
- SSH is unreachable
Every organization expects its Linux administrators to quickly identify the root cause and restore services.
Troubleshooting is one of the most valuable skills in Cloud Engineering, DevOps, Site Reliability Engineering (SRE), and Cybersecurity.
This lesson teaches a structured methodology for diagnosing and resolving Linux issues in enterprise environments.
Learning Objectives
Section titled “Learning Objectives”After completing this lesson, you will be able to:
- Follow a structured troubleshooting methodology.
- Monitor CPU, memory, storage, and networking.
- Analyze Linux logs.
- Troubleshoot services.
- Diagnose performance issues.
- Investigate common Linux problems.
- Apply enterprise troubleshooting best practices.
What is Troubleshooting?
Section titled “What is Troubleshooting?”Troubleshooting is the process of:
- Identifying problems
- Finding the root cause
- Resolving the issue
- Verifying the solution
- Preventing recurrence
A structured approach reduces downtime and improves system reliability.
Enterprise Troubleshooting Workflow
Section titled “Enterprise Troubleshooting Workflow”Successful administrators follow a consistent process.
Problem Report
↓
Collect Information
↓
Identify Symptoms
↓
Analyze Logs
↓
Determine Root Cause
↓
Implement Fix
↓
Verify Resolution
↓
Document FindingsNever jump directly to conclusions without gathering evidence.
Step 1 — Gather Information
Section titled “Step 1 — Gather Information”Before making changes, collect information.
Questions to ask:
- What changed?
- When did the issue begin?
- Is the issue affecting everyone?
- Which application is impacted?
- Are there any recent deployments?
- Are there recent configuration changes?
Understanding the scope helps narrow the investigation.
Step 2 — Check System Health
Section titled “Step 2 — Check System Health”View system uptime.
uptimeExample:
15:42:21 up 42 days
load average: 0.25, 0.30, 0.35This provides:
- Uptime
- Logged-in users
- System load
Check CPU Usage
Section titled “Check CPU Usage”Monitor running processes.
topor
htopLook for:
- High CPU usage
- Stuck processes
- Zombie processes
- Excessive load
Check Memory Usage
Section titled “Check Memory Usage”Display memory statistics.
free -hExample:
Total
Used
Free
AvailableLow available memory may cause slow performance or swapping.
Check Disk Usage
Section titled “Check Disk Usage”Display storage usage.
df -hExample:
Filesystem
Use%
95%If a partition reaches 100%, applications may fail.
Identify Large Directories
Section titled “Identify Large Directories”Find directories consuming space.
du -sh /*Example:
du -sh /var/logUseful for locating oversized log files or backups.
Check Running Services
Section titled “Check Running Services”Verify service status.
systemctl status nginxExample:
Active:
runningIf inactive, investigate why the service stopped.
Restart a Failed Service
Section titled “Restart a Failed Service”Restart the service.
sudo systemctl restart nginxThen verify its status.
systemctl status nginxAnalyze Logs
Section titled “Analyze Logs”Most Linux problems leave evidence in log files.
System logs:
journalctlAuthentication logs:
Ubuntu
/var/log/auth.logRed Hat
/var/log/secureApplication logs:
/var/log/nginx/
/var/log/apache2/
/var/log/mysql/Logs are often the fastest way to identify the root cause.
View Recent Log Entries
Section titled “View Recent Log Entries”Display recent logs.
journalctl -xeView logs for a service.
journalctl -u nginxCheck Network Connectivity
Section titled “Check Network Connectivity”Verify IP configuration.
ip addrCheck routing.
ip routeTest connectivity.
ping google.comVerify DNS.
dig google.comMany application issues are caused by network or DNS problems.
Check Open Ports
Section titled “Check Open Ports”Display listening services.
ss -tulnExample:
22
SSH
443
HTTPSIf the expected port is missing, the service may not be running.
Verify Process Health
Section titled “Verify Process Health”Locate a process.
ps -ef | grep nginxDisplay process tree.
pstreeTerminate a hung process if necessary.
kill PIDInvestigating User Issues
Section titled “Investigating User Issues”Check logged-in users.
whoView login history.
lastCheck failed logins.
lastbThese commands help identify authentication problems.
Verify File Permissions
Section titled “Verify File Permissions”Display permissions.
ls -lIncorrect permissions frequently cause:
- Application failures
- Access denied errors
- Service startup failures
Check Scheduled Jobs
Section titled “Check Scheduled Jobs”View cron jobs.
crontab -lSystem-wide cron configuration.
cat /etc/crontabAutomation failures often originate from scheduled tasks.
Troubleshooting Boot Issues
Section titled “Troubleshooting Boot Issues”View boot performance.
systemd-analyzeView failed services.
systemctl --failedReview boot logs.
journalctl -bThese commands help diagnose startup failures.
Common Linux Problems
Section titled “Common Linux Problems”High CPU Usage
Section titled “High CPU Usage”Possible causes:
- Infinite loops
- Heavy applications
- Malware
- Resource-intensive processes
Commands:
top
htopHigh Memory Usage
Section titled “High Memory Usage”Possible causes:
- Memory leaks
- Large applications
- Insufficient RAM
Commands:
free -h
topDisk Full
Section titled “Disk Full”Symptoms:
- Unable to save files
- Database failures
- Log write failures
Commands:
df -h
du -shService Won’t Start
Section titled “Service Won’t Start”Check:
- Logs
- Configuration
- Port conflicts
- Permissions
Commands:
systemctl status
journalctlNetwork Problems
Section titled “Network Problems”Check:
- Interface
- Gateway
- DNS
- Firewall
- Routing
Commands:
ip
ping
dig
ssSSH Connection Failed
Section titled “SSH Connection Failed”Verify:
- SSH service
- Firewall
- Network connectivity
- Port 22
Commands:
systemctl status ssh
ss -tulnTroubleshooting in Cloud Computing
Section titled “Troubleshooting in Cloud Computing”Cloud Engineers frequently investigate:
- EC2 startup failures
- High CPU utilization
- Full EBS volumes
- Security Group issues
- Route table problems
- DNS resolution failures
- Load balancer health checks
Linux troubleshooting skills directly translate to cloud environments.
Troubleshooting in Kubernetes
Section titled “Troubleshooting in Kubernetes”Common investigations include:
- Pods stuck in Pending
- CrashLoopBackOff
- Node Not Ready
- Image Pull Errors
- DNS failures
- Storage mount issues
Linux logs and networking knowledge are essential when troubleshooting Kubernetes clusters.
Troubleshooting in Cybersecurity
Section titled “Troubleshooting in Cybersecurity”Security teams investigate:
- Failed logins
- Unauthorized processes
- Suspicious network connections
- Privilege escalation attempts
- Malware activity
- Log anomalies
Many incident response investigations begin with Linux system analysis.
Essential Troubleshooting Commands
Section titled “Essential Troubleshooting Commands”Display system uptime:
uptimeMonitor processes:
topMemory usage:
free -hDisk usage:
df -hDirectory size:
du -shView logs:
journalctlService status:
systemctl statusRunning processes:
ps -efOpen ports:
ss -tulnNetwork configuration:
ip addrReal-World Example
Section titled “Real-World Example”A company’s website becomes unavailable.
The Linux administrator follows this workflow:
Website Down
↓
Ping Server
↓
SSH Login
↓
Check CPU & Memory
↓
Verify Disk Space
↓
Check NGINX Status
↓
Review NGINX Logs
↓
Restart Service
↓
Verify Website
↓
Document Root CauseFollowing a structured methodology reduces downtime and improves incident response.
Best Practices
Section titled “Best Practices”As a Linux administrator:
- Follow a structured troubleshooting process.
- Never assume the root cause.
- Collect evidence before making changes.
- Review logs before restarting services.
- Monitor CPU, memory, storage, and networking regularly.
- Document incidents and resolutions.
- Test changes in a lab before production.
- Automate health checks where possible.
A disciplined troubleshooting approach leads to faster resolution and more stable systems.
Key Takeaways
Section titled “Key Takeaways”After completing this lesson, you should understand:
- Enterprise troubleshooting methodology.
- CPU, memory, and storage diagnostics.
- Service troubleshooting.
- Log analysis.
- Network troubleshooting.
- Common Linux issues.
- Enterprise troubleshooting best practices.
Summary
Section titled “Summary”Linux Administration & Troubleshooting is one of the most important operational skills in IT.
Whether you’re managing cloud infrastructure, supporting production applications, administering Kubernetes clusters, or responding to cybersecurity incidents, your ability to quickly identify and resolve issues directly impacts business operations.
By following a structured troubleshooting methodology and mastering Linux diagnostic tools, you’ll be prepared to manage enterprise Linux systems with confidence.
Next Lesson
Section titled “Next Lesson”➡️ Lesson 14 — Enterprise Linux Administration
In the next lesson, you’ll learn how Linux is managed in large organizations, explore enterprise administration practices, automation, monitoring, patch management, compliance, documentation, and operational excellence used by professional Linux and cloud teams.