开启root用户远程登陆.sh
555 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
1. 修改 SSH 配置文件
打开配置文件:
sudo nano /etc/ssh/sshd_config
找到以下这一行(可能被注释掉了):
#PermitRootLogin prohibit-password
将其修改为:
PermitRootLogin yes
如果你只想允许 root 用密钥登录,使用:
PermitRootLogin without-password
或新版中等价于:
PermitRootLogin prohibit-password
2. 设置 root 密码(如果还没有)
sudo passwd root
3. 重启 SSH 服务
sudo systemctl restart ssh
4. 测试远程登录
使用 SSH 客户端登录:
ssh root@your.debian.ip