计算机网络/计算机科学与应用/系统/运维/开发

CentOS8 忘记登录密码怎么办?密码破解

1、开机,按e字符进入编辑模式

image.png

2、rd.break

在linux内核这行,按end键进入quiet 后,在quiet后加入rd.break

image.png

3、按ctrl+x进入swtch_root 模式

4、mount -o remount,rw /sysroot 重新挂载根分区

5、切换根分区 chroot /sysroot

image.png

6、passwd root  修改root的密码 必须是8位以上复杂密码

image.png


7、touch /.autorelabel,selinux在重启后更新label

image.png

8、exit  退出

9、reboot  重启

10、使用新密码登陆即可

Centos8

只有惜缘,才有缘分;只有惜友,才有友谊。

评论

^