linux-3重置root密码

1、首先确认是redhat7 

[root@localhost /]# cat /etc/redhat-release

 详细步骤: 

 第1步:开机后在内核上敲击"e".

 第2步:在linux16这行的后面输入"rd.break"并敲击"ctrl+x"

第3步:系统进入紧急救援模式。

第四输入一步:依次输入一下命令:

mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch /.autorelabel
exit
reboot

第5步:重启会很慢,请耐心等待

原文地址:https://www.cnblogs.com/hjweifans/p/6155297.html