系统相关
首页 > 系统相关> > linux重置密码

linux重置密码

作者:互联网

方法一:

进入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

方法二:

进入grub菜单界面
按e键 在linux开头的行找到ro 改为rw init=/sysroot/bin/bash
按ctrl+x
chroot /sysroot
passwd root
输入两次密码
touch /.autorelabel #selinux开启需要打标签,如果selinux未开启,可以忽略此步
exit
reboot

标签:grub,ctrl,selinux,重置,开启,密码,linux,sysroot
来源: https://www.cnblogs.com/wdy001/p/16560493.html