Centos 7 Root 密碼破解

一、重啓Linux,系統啓動進入歡迎界面時,加載內核步驟時,按e,而後選中Centos Linux (3.10.0-327.e17.x86_64) 7 (Core)"
Centos 7 Root 密碼破解linux

二、將linux 16這一行的ro 更改成 rw init=/sysroot/bin/sh,以下圖:
Centos 7 Root 密碼破解
Centos 7 Root 密碼破解
三、按下Ctrl+X重啓並進入單用戶模式,
Centos 7 Root 密碼破解
四、執行chroot /sysroot 訪問系統,並使用password修改root密碼
Centos 7 Root 密碼破解
五、更新系統信息,touch /.autorelabel,執行命令 touch /.autorelabel,在/目錄下建立一個.autorelabel文件,若是該文件存在,系統在重啓時就會對整個文件系統進行relabelling從新標記,能夠理解爲對文件進行底層權限的控制和標記。若是selinux屬於disabled 關閉狀態則不須要執行這條命令
Centos 7 Root 密碼破解
六、重啓並使用新密碼進入系統ide

相關文章
相關標籤/搜索