centos8重置root密码

1.开启centos8,进入启动页面

 

2.按’e’进入编辑模式(edit select item)

 

 3.ro改为 rw init=/sysroot/bin/bash

 

 4.按Crtl+X启动

 

 5.运行命令: ‘chroot/sysroot/’ (用chroot 命令把根目录切换到我们原来的环境中,也可以理解为以 root 权限登录了原来的系统)
设置环境为英文环境: ‘LANG=en’;
修改密码:'passwd’

 

 6.使SELinux 生效:输入 touch /.autorelabel

 7.reboot(重启)

 

posted @ 2020-07-28 11:37  Mr靳先生  阅读(1425)  评论(0编辑  收藏  举报