說明:
本文檔已在CentOS 7.2 內核版本 3.10.0 系統中測試成功;
--------------------------------------------------------------------------------------------------------
第一個里程碑 -- 在啟動GRUB菜單中選擇編輯選項,按鍵 "e" 進入編輯;
第二個里程碑 -- 大約在第16行找到 "ro" 將 "ro" 修改為 " rw init=/sysroot/bin/bash ";
第三個里程碑 -- 同時按下 " ctrl + x ",進入單用戶模式;
第四個里程碑 -- 用 "chroot /sysroot " 命令進入系統;
第五個里程碑 -- " passwd root " 重置root密碼;
第六個里程碑 -- 用 " touch /.autorelabel " 更新SELinux信息;
第七個里程碑 -- 輸入 " exit "退出 chroot ;
第八個里程碑 -- 用 " reboot -f " 重啟你的系統;
第九個里程碑 -- 登陸系統測試;
參考文檔: https://www.unixmen.com/reset-root-password-centos-7/
聲明: 本文檔本着開源精神,一起探討,共同進步!!!