centos7 更改root 密码

1.开机 按 e 键  utf8 后面 添加  rw init=/sysroot/bin/sh    按 ctrl -x 

2.输入命令 chroot  /sysroot

3. 输入命令 passwd root   ,输入密码回车 再输入一次 回车

4.输入命令 touch  /.autorelabel

5.输入命令 chroot exit ,exit , reboot

posted @ 2023-08-09 15:10  ForMeDream  阅读(1262)  评论(0编辑  收藏  举报