在开机界面,按”e”进入编辑界面
按”e”进图下图界面后,找到开头为”linux16″行,在行后面加入 “init=/bin/sh”
输入后,按快捷键Ctrl+x 进入单用户模式
然后再行最后输入mount -o remount,rw / 注意各个空格有空格
回车
在新的一行后面输入 passwd,回车
然后输入密码,(8为以上最好,但是不是必须的),出现passwd字样则为修改成功
在新的一行后面,输入 touch /.autorelabel 回车,注意然后回车touch后面有个空格
然后再光标闪烁的位置,输入:exec /sbin/init 回车,注意exec与/后面有个空格
流程有点长,完成后系统会自动启动,新密码生效。
[En]
The process is a bit long, the system will start automatically when it is finished, and the new password will take effect.
Original: https://www.cnblogs.com/zhongxiaochuan/p/16048090.html
Author: 钟小川
Title: Centos7 找回root密码
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/523962/
转载文章受原作者版权保护。转载请注明原作者出处!