kcxg
#在vmlinuz段最后添加rd.break Ctrl+X启动
rd.break
#在linux16/linux/linuxefi所在参数行尾添加以下内容
init=/bin/sh
#此时,可使用mount查看挂载情况,/dev/mapper/rhel-root on /sysroot type xfs并且仅有ro权限
#重新mount,拥有rw权限
mount -o remount,rw /sysroot
#改变根
chroot /sysroot
echo "rot" | passwd --stdin root
#修改前最好备份原来的密码/etc/shadow
#使selinux生效,系统在重启时就会对整个文件系统进行relabeling
touch /.autorelabel
exit
reboot

 

分类:

技术点:

相关文章:

  • 2021-09-27
  • 2021-09-27
  • 2021-11-22
  • 2021-10-29
  • 2021-08-29
猜你喜欢
  • 2021-11-05
  • 2021-05-16
  • 2022-02-01
  • 2022-12-23
  • 2021-09-27
相关资源
相似解决方案