> ## 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 控制面板启用 Root 登录 (Debian 12)

默认情况下，Cockpit 通过 `disallowed-users` 列表限制 root 用户登录。要允许 root 访问，你需要从此文件中删除 `root` 条目。

### ✅ 启用 Root 登录的步骤

1. **编辑 disallowed-users 文件**  
   使用具有 root 权限的文本编辑器打开该文件：

```
   sudo nano /etc/cockpit/disallowed-users
```
2. **删除** `root` **行**  
   如果你看到仅包含以下内容的一行：

```
   root
```

   注释掉该行：

```
   # root
```
3. **保存更改**

* 在 Nano 中，按 `Ctrl+X`，然后按 `Y`，然后按 `Enter` 保存并退出。
4. **重新启动 Cockpit 服务**  
   为了使更改生效，请重新启动 Cockpit：

```
   sudo systemctl restart cockpit
```

   *（重新启动系统是可选的，但通常不需要。）*

---

### ⚠️ 重要注意事项

* **🔐 安全风险**  
  启用 root 登录会增加攻击面。使用具有 `sudo` 权限的非 root 用户进行日常任务更安全。
* **🔑 替代身份验证**  
  考虑实施 Kerberos、SSH 密钥或证书以进行更安全的身份验证。
* **🧱 防火墙访问**  
  确保你的防火墙允许 **TCP 端口 9090** 上的流量，Cockpit 使用该端口。
* **👤 管理其他用户**  
  你可以通过将用户名（每行一个）添加到 `/etc/cockpit/disallowed-users` 来限制其他用户。