CentOS 7忘记root密码解决办法

esc进入菜单栏

e编辑模式

Ctrl+X启动

passwd修改密码

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