Q: An ex-employee changed the root password of a critical bare-metal Linux server and left. You have physical access to the server but do not know the password. How do you regain control?
Since physical access is available, the root password can be reset by interrupting the bootloader (GRUB).
rd.break.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Want to master this scenario in a live sandbox? The Linux Foundation's Certified System Administrator (LFCS) & SRE Track covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "In an interview, I explain my systematic Linux troubleshooting methodology using Brendan Gregg's USE method. The interviewer is testing: GRUB manipulation, Rescue Mode, rd.break.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."
Initial Diagnostics & Root Cause Analysis
Since physical access is available, the root password can be reset by interrupting the bootloader (GRUB).
- Reboot the server. When the GRUB menu appears, press
eto edit the kernel boot parameters. - Find the line starting with
linuxorlinux16. Appendrd.break(on RHEL/CentOS) orinit=/bin/bash(on Debian/Ubuntu) to the end of that line, and press Ctrl+X to boot. - This drops you into an emergency root shell *before* the system fully mounts or asks for a password.
Remediation & Permanent Safeguards
- Mount the actual root filesystem mathematically with read-write access:
mount -o remount,rw /sysrootandchroot /sysroot. - Run the
passwdcommand to comfortably set a new root password. Exit and reboot.
- Reboot the server. When the GRUB menu appears, press e to edit the kernel boot parameters.
- Find the line starting with linux or linux16. Append rd.break (on RHEL/CentOS) or init=/bin/bash ...
- This drops you into an emergency root shell *before* the system fully mounts or asks for a password.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Issuing immediate kill -9 (SIGKILL) commands rather than allowing graceful termination via kill -15 (SIGTERM) when configuring employee changed root SIGKILL immediately halts execution without allowing processes to flush memory buffers, commit database transactions, or remove stale PID locks.
-
Overlooking file system inode exhaustion (df -i) when diagnosing 'No space left on device' errors when configuring employee changed root
Millions of small files or unrotated session tokens can exhaust available file system inodes even when standard disk storage (
df -h) shows ample free space. - Exhausting open file descriptor allocations (ulimit -n) under intensive concurrent socket connections when configuring employee changed root Reaching file descriptor exhaustion throws 'Too many open files' errors, preventing services from accepting new TCP client socket connections.
-
Permitting defunct zombie processes to accumulate without fixing parent process SIGCHLD waitpid reaping when configuring employee changed root
Zombie processes consume process table entries; accumulating zombies can exhaust the system maximum PID limit (
pid_max).