> ## 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).

# 由于 root SSH 访问被禁用，无法对 Debian 目标服务器执行远程备份

在Debian OS目标服务器上通过终端为远程备份解锁Root的SSH访问

### **问题**

无法对Debian目标服务器执行远程备份。

Debian默认情况下已禁用root用户的SSH访问。

### **解决方案**

启用root用户的SSH访问。

1. 访问远程服务器的终端/控制台。
2. 运行以下命令允许root登录：

```
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
```

3. 运行以下命令重启SSH服务：

```
systemctl restart sshd.service
```
|| 注意：执行备份操作后，出于安全考虑，可能需要再次禁用root访问。

### 要重新保护root帐户：

1. 访问远程服务器的终端/控制台。
2. 运行以下命令禁用root登录：

```
   sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/g' /etc/ssh/sshd_config
```
3. 运行以下命令重启SSH服务：

```
   systemctl restart sshd.service