1.打开电源在进入系统的界面按‘e’进入编辑页面:2.在linux16开头的字段的末尾处添加: init=/bin/sh3.按“ctrl+X”组合键进入单用户模式当进入以下页面表示进入单用户模式成功,在进入单用户模式后,文件系统是只读的,输入‘mount -o remount,rw /’命令来改为读写模式4.使用命令‘passwd’重置密码:5.使用‘touch /.autorelabel’创建selinux安全标签6.使用‘exec /sbin/init’重新引导进程并重启
init=/bin/sh
mount -o remount,rw /
passwd
touch /.autorelabel
exec /sbin/init
验证登陆成功: