本文介紹如何在忘記 root 密碼時,從開機階段重設密碼。
第一步需要在開機選單中輸入 e。
尋找 linux16 項目,按END鍵就可以將游標移到最後面,並在最後面在入 rd.break。
輸入下列指令:
1.mount -o remount,rw /sysroot
2.chroot /sysroot
3.passwd root ,enter後輸入密碼enter,然後再輸入一次enter
4.touch /.autorelabel
5.輸入exit 兩次
若系統有啟用 SELinux,則會等待 SELinux 重新設定所有檔案的 context。待開機完成,使用新的密碼登入即可。
沒有留言:
張貼留言