> ## Content Index
> Fetch the complete content index at: https://oyang.cc/llms.txt
> Use this file to discover other available public pages before exploring further.

# Centos7重置root密码
- URL: https://oyang.cc/centos7_reset_root_password/
- Published: 2018-11-27T16:02:28.000Z
- Updated: 2018-11-27T16:02:37.000Z
- Author: 轶语林
- Tags: centos, linux

## 1.启动Centos7系统，出现下面画面时按“e”键。

![centos7_reset_root_password_01](https://oyang.cc/content/images/2018/11/centos7_reset_root_password_01.png)

## 2\. 在下图位置添加“rw single init=/bin/bash”，然后安“Ctrl+X”引导系统。

![centos7_reset_root_password_02](https://oyang.cc/content/images/2018/11/centos7_reset_root_password_02.png)

## 3\. 挂载根分区

`bash-4.2# mount -o remount, rw /`

## 4\. 键入“passwd”即可重置密码。

![centos7_reset_root_password_05-1](https://oyang.cc/content/images/2018/11/centos7_reset_root_password_05-1.png)

## 5\. 运行命令“exec /sbin/init”来正常启动系统，需要输入修改后的root密码

![centos7_reset_root_password_04-1](https://oyang.cc/content/images/2018/11/centos7_reset_root_password_04-1.png)