CentOS 7忘记root密码解决办法
1.重启开机按esc
2.选择第二个菜单,按e
3.编辑修改两处:ro改为rw,在LANG=en_US.UFT-8后面添加init=/bin/sh

4.按Ctrl+X重启,并修改密码

5.由于selinux开启着的需要执行以下命令更新系统信息,否则重启之后密码未生效
touch /.autorelabel
6.重启系统
exec /sbin/init

CentOS 7忘记root密码解决办法
原文:https://blog.51cto.com/1191997818/2424570