linux单用户模式恢复密码随记(备忘)

centos 7

1、开机 shift或e

2、e编辑模式中,找到rd,改成 rw init=/sysroot/bin/sh

3、ctl + x

4、进入命令行

5、chroot /sysroot/

6、passwd root

7、touch /.autorelabel

8、exit退出后 reboot重启

 

posted @ 2017-02-04 17:24  gabin  阅读(211)  评论(0)    收藏  举报