Centos 7修改root密码

修改root密码:

1 - 在启动grub菜单,选择编辑选项启动
 
2 - 按键盘e键,来进入编辑界面
 
3 - 找到if之后linux 16的那一行,将ro改为rw init=/sysroot/bin/sh
 
4 - 按下 Control+x ,使用单用户模式启动
 
5 - 使用命令访问系统: "chroot /sysroot"
 
6 - 重置密码"passwd root"
 
7 - 更新selinux信息:"touch /.autorelabel"
 
8 - 退出chroot:"exit"
 
9 - 重新启动系统:"reboot",密码修改完成。
 
 
posted @ 2017-03-17 16:05  MILAS  Views(91)  Comments(0)    收藏  举报