# CentOS7如何重置root密码

> 来源：梦飞idc云平台 | 原文：https://www.mfisp.com/9521.html | 发布：2022-08-31 | 更新：2022-08-31 | 分类：服务器vps推荐

1）开启虚拟机

 

2）在弹出这个界面时，按上下键防止页面跳转，选择"CentOS Linux (3.10.0-1160. e17. x86 64) 7 (Core)"并按e

 

3）找到ro crashkernel=auto xxx，把ro换成rw init=/sysroot/bin/sh

 

4）使用组合键Ctrl+X进入单用户模式

 

5）chroot /sysroot访问系统

 

6）passwd root重新输入新的root用户密码

 

7）touch /.autorelabel创建标签文件

 

8）exit返回刚刚的单用户模式

 

9）reboot重启系统

---
本页由 梦飞idc云平台（https://www.mfisp.com）提供。站点导航见 https://www.mfisp.com/llms.txt
