CentOS 7 : 重置root密码

开机按 E 键可以进入编辑模式 GRUB 2
1、在 rhgb and quiet 的后面添加

init=/bin/sh
selinux=0

CTRL+X
2、重置密码

mount -o remount, rw /
passwd root

3、有错误提示执行

touch /.autorelabel

5、重启

exec /sbin/init
exec /sbin/init
exec /sbin/reboot

转自:Pomelolee.com/1518.html