Linux root 密碼遺失無法登入系統,可透過 GRUB 進入單用戶模式或安裝光碟進入救援模式重設密碼。適用 Red Hat/CentOS/Fedora/Debian/Ubuntu 等主流發行版,步驟大同小異。
vmlinuz 字樣) 再按 e。single (或 1、init=/bin/bash) → Enter。init=/bin/bash,需手動重掛載根目錄可寫:mount -o remount,rw /passwd root 設定新密碼 (輸入兩次)。sync → reboot 重開機,新密碼生效。






/mnt/sysimage (或提示掛載位置)。chroot /mnt/sysimage 切換根環境。passwd root 修改密碼。exit 退出 chroot → exit 退出救援環境 → 移除光碟重開機。







linux / linux16 / linuxefi 行尾加 rd.break 或 init=/bin/bash → Ctrl+x 啟動 → mount -o remount,rw /sysroot → chroot /sysroot → passwd → touch /.autorelabel (SELinux) → reboot。/etc/shadow 備份、檢查 SSH 金鑰登入設定、通知相關人員。touch /.autorelabel 否則下次開機會因標籤錯誤卡住。掌握雙重恢復法,Root 密碼遺失不再慌,幾分鐘內重獲系統最高控制權。