重置CentOS7的密码
在GRUB菜单按键盘字母
e
进入编辑模式在字符UTF-8后面输入
rd.break
后CTRL+X
启动mount -o remount,rw /sysroot
chroot /sysroot
使用
passwd
命令修改密码touch /.autorelabel
退出&重启
备注:
第 2 步的时候输入init=/bin/sh
并按CTRL+X
同样可用;
第 5 步的时候出现方块或乱码可输入LANG=en
切换语言;
第 5 步也可以用echo "123456" | passwd --stdin root
修改密码;
第 7 步可以用exit
退出并使用reboot
重启。
文档更新时间: 2019-12-06 18:08 作者:葛伟光