重置centos 7 root密码

一、一、启动的时候,在启动界面,相应启动项,内核名称上按“e”;
二、进入后,找到linux16开头的地方,按“end”键到最后,输入rd.break,按ctrl+x进入;
三、 mount -o remount,rw /sysroot
四、 chroot /sysroot
五、 passwd修改密码
六、touch /.autorelabel
七、grep SELINUX /etc/selinux/config
八、sed -i 's#SELINUX=enforcing#SELINUX=disable#' /etc/selinux/config
九、exit;exitlinux

相关文章
相关标签/搜索