Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Linux 忘記 root 密碼?進入單用戶模式重設密碼完整步驟

編輯:關於 Linux

操作流程

  1. 開機出現 GRUB 倒數選單時,按任意鍵停止。

  2. 選擇啟動項,按 a 編輯核心參數。

  3. 在核心參數行末加入 single 或 init=/bin/bash,按 Enter 啟動。

  4. 進入單用戶模式後,根分區通常以唯讀掛載,先重掛為可寫:
    mount -o remount,rw /
  5. 重設密碼:passwd root → 輸入新密碼兩次。
  6. 重啟:reboot 或 exec /sbin/init。

結語

單用戶模式繞過正常登入驗證,配合 passwd 即可快速找回 root 控制權。

Copyright © Windows教程網 All Rights Reserved