1、在开始之前,先确认系统是否为RHEL 8(Red Hat Enterprise linux 8),可使用下方命令进行查看;
[root@linuxprobe ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.0 (Ootpa)
2、重启Linux系统主机在出现如下引导界面时,按下键盘上的e键进入内核编辑界面;

Linux系统引导界面
3、在linux参数这行的最后,修改rhgb quiet为rd.break

内核信息编辑界面
4、按下Ctrl + X组合键运行修改过的内核程序;

内核信息编辑界面
5、大约10秒后,系统进入紧急救援模式;

Linux系统紧急救援模式
6、依次输入以下命令;
mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch /.autorelabel
当输入完第三条命令passwd,系统提示New password,此时输入要修改的新密码,因为密码属于加密信息,在输入时,不会显示,正常输入新密码即可,然后点击回车键,系统提示Retype new password,再次输入新设置的密码,保持和上次的输入相同,然后“回车”,继续输入剩余命令;

重置Linux系统管理员密码
7、输入完以上命令后,连续按下两次Ctrl + D组合键盘来退出紧急救援模式并重启系统,等待系统再次重启完毕;

8、使用新密码登录root账户,至此,Linux系统密码重置完毕。
