Rocky9.2 忘记密码怎么重置-进入系统时操作

#方法一:

进入grub菜单界面

按e键  在linux开头的行按ctrl+e 或者end跳到行尾,输入rd.break

按ctrl+x

mount -o remount,rw /sysroot

chroot /sysroot

passwd root

输入两次密码

touch /.autorelabel    #selinux开启需要打标签,如果selinux未开启,可以忽略此步

exit

reboot
 

#方法二:(也适用于ubuntu1804)

进入grub菜单界面

按e键  在linux开头的行找到ro 改为rw init=/sysroot/bin/bash

按ctrl+x

chroot /sysroot

passwd root

输入两次密码

touch /.autorelabel    #selinux开启需要打标签,如果selinux未开启,可以忽略此步

exit

reboot
 

猜你喜欢

转载自blog.csdn.net/qq_33468857/article/details/132474256
9.2