1、重启操作系统
# reboot -f
2、重启后进入引导界面
按字符e键,将光标移到第13行尾删除rhgb quiet并在最后加上init=/bin/sh,按Ctl+x启动Linux系统;
3、进入单用户模式修改root密码:
sh-4.2# mount -o remount,rw /
sh-4.2# passwd
或
sh-4.2# echo "redhat" | passwd --stdin root
4、重打SELinux标签
sh-4.2# touch /.autorelable
sh-4.2# exec /sbin/init
5、用root用户重新登录系统完成恢复。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9034054/viewspace-1970328/
,如需转载,请注明出处,否则将追究法律责任。