当忘记Linux密码时你会怎么办?本篇文章为大家分享一下快速破解linux密码的方法,有需要的小伙伴可以参考一下。

1.在grub引导界面(如下图)按e进入编辑模式

2.按↓键,找到以linux16开头的行,在最后加上 rd.break(如下图,注意前面有一个空格)

3.按Ctrl+x进入救援模式
4.重新挂载/sysroot为可读写模式,并切换根目录为/sysroot
# mount -o remount,rw /sysroot
# chroot /sysroot
5.执行相关命令,例如更换密码
# passwd root
6.更新selinux上下文
# touch /.autorelabel
7.输入exit两次退出重启
以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !
