> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://helpdesk.ggcircuit.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 🔧 重置 Debian 上的根密码

如果您忘记了 Debian 系统的 root 密码，您可以按照以下步骤重置它：

### 1. 重新启动系统

如果您的系统正在运行，请重新启动它。

### 2. 访问 GRUB 菜单

当系统开始启动时，您应该看到 **GRUB 菜单**。  
如果它没有自动出现，请在启动期间**按住** `Shift` **键**直到出现为止。

### 3. 编辑启动参数

* 使用箭头键突出显示**默认启动选项**（通常是第一个）。
* 按下 `e` 来编辑启动条目。

### 4. 修改 Linux 行

* 找到以 `linux` 开头的行。
* 导航到此行的末尾，**添加一个空格**，并附加以下内容：

```
  init=/bin/bash
```

### 5. 启动到恢复模式

按下 `Ctrl + X`（或某些系统上的 `F10`）以使用修改后的参数启动。  
这将启动一个最小的 shell 环境。

### 6. 重新挂载根文件系统

一旦进入 shell 提示符，使根文件系统可写：

```
mount -o remount,rw /
```

### 7. 更改 Root 密码

现在重置 root 密码：

```
passwd
```

在提示时输入新密码并确认它。

### 8. 重新启动系统

更新密码后，重新启动：

```
reboot
```

您的系统将正常重新启动，现在您应该能够使用新密码以 root 身份登录。