UBUNTU LINUX ADVANCED TROUBLESHOOTING SCENARIOS Generated: Thu Feb 26 06:10:09 MST 2026 Total scenarios: 30000 Features: Dynamic difficulty, system state tracking, progressive degradation 📋 PROBLEM: System is running slowly and needs investigation. Users report intermittent failures. 💻 SYSTEM CONTEXT: • OS: Ubuntu 22.04.1 LTS (Jammy Jellyfish) • Kernel: 5.15.0-56-generic • Hostname: staging-139-169-41prod • User: deploy • Uptime: 9 days, 13:00 • Load average: 0.64, 2.98, 0.60 ⚠️ ERROR MESSAGE: High load average and application timeouts 🔍 AVAILABLE COMMANDS: 1. kill -9 1 └ Kill init/systemd process 2. top -b -n 1 └ Check running processes and resource usage 3. echo 3 > /proc/sys/vm/drop_caches └ Drop filesystem caches 4. reboot └ Restart the system (drastic) ❓ Which command would you run to troubleshoot this issue? deploy@staging-139-169-41prod:~$ top -b -n 1 📤 COMMAND OUTPUT: top - 06:10:09 up 9 day, 5 users, load average: 0.64, 2.98, 0.60 Tasks: 20 total, 2 running, 18 sleeping, 0 stopped, 0 zombie %Cpu(s): 6.4 us, 14.9 sy, 0.0 ni, 73.7 id, 3.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 5 total, 2 free, 2 used, 1 buff/cache MiB Swap: 3 total, 3 free, 0 used. 2 avail Mem PID USER PR NI VIRT RES SHR S %%CPU %%MEM TIME+ COMMAND 1006 root 20 0 634 88 88 S 9.9 2.8 937:28 /usr/sbin/postgresql 1013 root 20 0 218 90 90 S 8.4 0.6 478:53 /usr/sbin/php8.2-fpm 1001 root 20 0 144 79 79 S 8.2 2.3 1065:54 /usr/sbin/ufw 1002 root 20 0 412 63 63 S 8.1 3.2 820:56 /usr/sbin/ssh 1008 mysql 20 0 113 83 83 S 7.5 3.8 425:04 /usr/sbin/mysql 1003 root 20 0 216 70 70 S 7.3 3.1 1304:37 /usr/sbin/php8.1-fpm 1010 root 20 0 434 86 86 S 7.3 0.4 1132:19 /usr/sbin/samba 678 root 20 0 551 78 78 S 7.0 0.4 986:15 /lib/systemd/systemd-udevd 1005 root 20 0 644 42 42 S 6.9 4.6 1430:15 /usr/sbin/snapd 892 systemd+ 20 0 268 78 78 S 6.5 2.7 8:21 /lib/systemd/systemd-timesyncd 🔍 Root cause: Multiple factors could cause slow performance: high CPU, memory pressure, I/O wait, or network issues. 🔧 Resolution: Use standard Linux troubleshooting tools to identify the bottleneck: top, iostat, vmstat, netstat. ✅ Verification: Identify the root cause and resolve accordingly. 📊 System state evolving... 📋 PROBLEM: Nginx fails to start with error 'Address already in use' on port 80. Apache was previously installed but should have been removed. 💻 SYSTEM CONTEXT: • OS: Ubuntu 20.04.5 LTS (Focal Fossa) • Kernel: 5.4.0-135-generic • Hostname: ip-237-151-2prod • User: dev1 • Uptime: 7 days, 21:00 • Load average: 2.85, 0.62, 0.53 ⚠️ ERROR MESSAGE: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 🔍 AVAILABLE COMMANDS: 1. ss -tulpn | grep :80 └ Find which process is using port 80 2. systemctl status nginx └ Check nginx status 3. journalctl -u nginx └ Check nginx logs 4. systemctl restart nginx └ Restart nginx (will likely fail again) ❓ Which command would you run to troubleshoot this issue? dev1@ip-237-151-2prod:~$ ss -tulpn | grep :80 📤 COMMAND OUTPUT: tcp LISTEN 0 128 0.0.0.0:80 0.0.0.0:* users:(("apache2",pid=1234,fd=4)) 🔍 Root cause: Another process (likely Apache) is still listening on port 80, preventing nginx from binding. 🔧 Resolution: Find the process using port 80: sudo ss -tulpn | grep :80. Stop the conflicting service: sudo systemctl stop apache2. Then start nginx. ✅ Verification: Start nginx and verify it's listening on port 80 with 'ss -tulpn | grep :80'. 📋 Recommended next steps: • systemctl stop apache2 • systemctl start nginx 📊 System state evolving... 📋 PROBLEM: Server load average is 1.6, 3.2, 2.3 and CPU temperature is unusually high at 51.2°C. Users report extreme sluggishness. 💻 SYSTEM CONTEXT: • OS: Ubuntu 23.10 (Mantic Minotaur) • Kernel: 6.5.0-14-generic • Hostname: db-94-5-224dev • User: admin • Uptime: 20 days, 22:00 • Load average: 1.60, 3.15, 2.25 ⚠️ ERROR MESSAGE: High CPU usage alert from monitoring (99% CPU) 🔍 AVAILABLE COMMANDS: 1. renice -n 19 -p 9217 └ Lower process priority 2. killall -9 crypto-miner └ Force kill processes by name 3. ps aux --sort=-%cpu | head -5 └ Find the most CPU-intensive process 4. systemctl isolate multi-user.target └ Change runlevel ❓ Which command would you run to troubleshoot this issue? admin@db-94-5-224dev:~$ ps aux --sort=-%cpu | head -5 📤 COMMAND OUTPUT: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND ubuntu 9371 99.5 3.5 285 10 ? Ss 0:47 /tmp/.crypto-miner root 1012 9.8 1.5 760 84 ? Ss 0:11 /usr/sbin/cron root 678 9.7 3.3 456 59 ? Ss 0:50 /lib/systemd/systemd-udevd root 523 9.7 1.3 438 55 ? Ss 0:20 /lib/systemd/systemd-journald root 1001 9.6 0.3 967 44 ? Ss 0:53 /usr/sbin/apache2 root 1004 8.9 0.1 877 94 ? Sl 0:19 /usr/sbin/bind9 root 1016 8.2 0.3 719 61 ? Ss 0:32 /usr/sbin/gitlab-runner root 1000 7.9 2.2 377 34 ? Sl 0:57 /usr/sbin/memcached root 1015 7.8 0.1 566 23 ? Ss 0:10 /usr/sbin/redis-server root 1005 7.5 3.3 907 65 ? Ss 0:23 /usr/sbin/rabbitmq-server root 1014 7.1 2.5 484 91 ? Ss 0:55 /usr/sbin/rsyslog root 1013 5.9 4.7 363 29 ? Ss 0:49 /usr/sbin/nginx systemd+ 892 5.3 0.4 222 52 ? Sl 0:05 /lib/systemd/systemd-timesyncd root 1017 5.0 4.9 506 54 ? Ss 0:25 /usr/sbin/php8.2-fpm mysql 1008 4.6 3.9 769 63 ? Ss 0:21 /usr/sbin/mysql root 1002 4.1 3.2 282 27 ? Sl 0:59 /usr/sbin/ufw root 1007 4.0 3.2 620 62 ? Sl 0:52 /usr/sbin/elasticsearch root 1010 3.4 4.1 315 43 ? Sl 0:46 /usr/sbin/samba root 1006 3.1 2.4 318 29 ? Ss 0:32 /usr/sbin/postgresql root 1011 2.4 4.1 718 63 ? Ss 0:23 /usr/sbin/network-manager root 2 2.4 2.1 651 48 ? Sl 0:10 [kthreadd] root 1003 2.4 0.8 164 27 ? Sl 0:05 /usr/sbin/ssh root 1009 1.3 1.6 110 45 ? Ss 0:20 /usr/sbin/prometheus root 1 1.0 1.6 401 48 ? Sl 0:47 /sbin/init root 3 0.0 4.7 514 49 ? Ss 0:04 [ksoftirqd/0] 🔍 Root cause: A crypto-miner process is consuming 99% CPU. Likely installed through compromised application or vulnerability. 🔧 Resolution: Terminate the process: kill -9 [PID]. Investigate how it was installed and remove the binary. Check for unauthorized access in auth.log. ✅ Verification: Run 'top' or 'ps aux' to confirm the process is gone. Monitor for reappearance. 📋 Recommended next steps: • kill -9 [PID] • rm -rf /tmp/.crypto-* • grep -r 'miner' /var/log/auth.log 📊 System state evolving... 📋 PROBLEM: User 'web' needs to install a package but gets 'Permission denied' when running apt install. They need to set up a new service. 💻 SYSTEM CONTEXT: • OS: Ubuntu 23.04 (Lunar Lobster) • Kernel: 6.2.0-39-generic • Hostname: app-134-184-151dev • User: web • Uptime: 24 days, 6:00 • Load average: 1.03, 0.16, 1.55 ⚠️ ERROR MESSAGE: E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) 🔍 AVAILABLE COMMANDS: 1. groups └ List user groups 2. cat /etc/sudoers | grep web └ Check sudoers file 3. sudo apt update └ Try updating package list with sudo 4. id └ Check user's group membership ❓ Which command would you run to troubleshoot this issue? web@app-134-184-151dev:~$ id 📤 COMMAND OUTPUT: uid=1169(web) gid=1169(web) groups=1169(web),web,adm 🔍 Root cause: User lacks sudo privileges or is not in the sudo group. 🔧 Resolution: Add user to sudo group: sudo usermod -aG sudo web (as root). Then log out and back in. ✅ Verification: Run 'sudo apt update' successfully. 📋 Recommended next steps: • sudo usermod -aG sudo web • newgrp sudo 📊 System state evolving... 📋 PROBLEM: System is running slowly and needs investigation. Users report intermittent failures. 💻 SYSTEM CONTEXT: • OS: Ubuntu 23.04 (Lunar Lobster) • Kernel: 6.2.0-39-generic • Hostname: worker-243-189-194001 • User: app • Uptime: 20 days, 3:00 • Load average: 0.54, 0.31, 1.90 ⚠️ ERROR MESSAGE: High load average and application timeouts 🔍 AVAILABLE COMMANDS: 1. top -b -n 1 └ Check running processes and resource usage 2. echo 3 > /proc/sys/vm/drop_caches └ Drop filesystem caches 3. reboot └ Restart the system (drastic) 4. kill -9 1 └ Kill init/systemd process ❓ Which command would you run to troubleshoot this issue? app@worker-243-189-194001:~$ top -b -n 1 📤 COMMAND OUTPUT: top - 06:10:09 up 20 day, 3 users, load average: 0.54, 0.31, 1.90 Tasks: 24 total, 2 running, 21 sleeping, 0 stopped, 0 zombie %Cpu(s): 5.4 us, 1.6 sy, 0.0 ni, 88.0 id, 1.3 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 12 total, 7 free, 4 used, 2 buff/cache MiB Swap: 17 total, 16 free, 0 used. 8 avail Mem PID USER PR NI VIRT RES SHR S %%CPU %%MEM TIME+ COMMAND 1006 root 20 0 182 89 89 S 9.8 3.3 594:58 /usr/sbin/elasticsearch 1008 mysql 20 0 429 81 81 S 9.7 1.0 910:09 /usr/sbin/mysql 1002 root 20 0 859 76 76 S 9.0 3.7 98:38 /usr/sbin/bind9 1003 root 20 0 780 74 74 S 8.3 2.6 1151:10 /usr/sbin/docker 3 root 20 0 601 53 53 S 7.9 3.9 1069:28 [ksoftirqd/0] 1016 root 20 0 549 76 76 S 7.9 0.2 552:21 /usr/sbin/gitlab-runner 678 root 20 0 605 71 71 S 6.6 4.7 1121:29 /lib/systemd/systemd-udevd 1010 root 20 0 553 92 92 S 6.3 3.2 268:37 /usr/sbin/mongodb 1009 root 20 0 330 78 78 S 5.8 2.0 1127:31 /usr/sbin/prometheus 1015 root 20 0 201 18 18 S 5.7 3.8 259:19 /usr/sbin/redis-server 🔍 Root cause: Multiple factors could cause slow performance: high CPU, memory pressure, I/O wait, or network issues. 🔧 Resolution: Use standard Linux troubleshooting tools to identify the bottleneck: top, iostat, vmstat, netstat. ✅ Verification: Identify the root cause and resolve accordingly. 📊 System state evolving... 📋 PROBLEM: User 'dev' reports they cannot write to a configuration file in /etc/nginx/sites-available/ that they need to update for a new site. 💻 SYSTEM CONTEXT: • OS: Ubuntu 22.04.3 LTS (Jammy Jellyfish) • Kernel: 5.15.0-91-generic • Hostname: ip-101-239-69dev • User: dev • Uptime: 22 days, 6:00 • Load average: 1.38, 1.79, 1.74 ⚠️ ERROR MESSAGE: Permission denied when saving file with editor 🔍 AVAILABLE COMMANDS: 1. chmod 777 /etc/nginx/sites-available/default └ Give everyone write access (dangerous) 2. sudo -u dev touch /etc/nginx/sites-available/test └ Test writing as current user 3. ls -la /etc/nginx/sites-available/ └ Check file permissions and ownership 4. chown dev:dev /etc/nginx/sites-available/default └ Change ownership to current user ❓ Which command would you run to troubleshoot this issue? dev@ip-101-239-69dev:~$ ls -la /etc/nginx/sites-available/ 📤 COMMAND OUTPUT: total 32 drwxr-xr-x 2 dev dev 4096 26 06 . drwxr-xr-x 5 dev dev 4096 26 06 .. -rw-r--r-- 1 root root 1234 26 06 config.properties -rw-rw-r-- 1 dev dev 567 26 06 document.txt -rwxr-xr-x 1 dev dev 890 26 06 script.sh 🔍 Root cause: Regular users don't have write permissions to system configuration directories. Files in /etc are owned by root. 🔧 Resolution: Use sudo to edit the file: sudo nano /etc/nginx/sites-available/default. Or fix permissions if appropriate (not recommended for system files). ✅ Verification: Successfully save the file with sudo. 📋 Recommended next steps: • sudo nano /etc/nginx/sites-available/default 📊 System state evolving... 📋 PROBLEM: User 'dev' needs to install a package but gets 'Permission denied' when running apt install. They need to set up a new service. 💻 SYSTEM CONTEXT: • OS: Ubuntu 22.04.2 LTS (Jammy Jellyfish) • Kernel: 5.15.0-69-generic • Hostname: prod-249-85-6402 • User: dev • Uptime: 16 days, 16:00 • Load average: 2.14, 2.42, 0.02 ⚠️ ERROR MESSAGE: E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) 🔍 AVAILABLE COMMANDS: 1. id └ Check user's group membership 2. sudo apt update └ Try updating package list with sudo 3. groups └ List user groups 4. cat /etc/sudoers | grep dev └ Check sudoers file ❓ Which command would you run to troubleshoot this issue? dev@prod-249-85-6402:~$ id 📤 COMMAND OUTPUT: uid=1021(dev) gid=1021(dev) groups=1021(dev),dev 🔍 Root cause: User lacks sudo privileges or is not in the sudo group. 🔧 Resolution: Add user to sudo group: sudo usermod -aG sudo dev (as root). Then log out and back in. ✅ Verification: Run 'sudo apt update' successfully. 📋 Recommended next steps: • sudo usermod -aG sudo dev • newgrp sudo 📊 System state evolving...