1、打开 /etc/ssh/sshd_config
- 将 PermitRootLogin prohibit-password 改为 PermitRootLogin yes
- 将 PasswordAuthentication no 中的 no 改为 yes
- 开启 Port 22
2、重启 ssh 服务
sudo systemctl restart sshd.service
如果还是出现连接不了,请确认服务防火墙是否 开启了 22 端口
1、打开 /etc/ssh/sshd_config
2、重启 ssh 服务
sudo systemctl restart sshd.service
如果还是出现连接不了,请确认服务防火墙是否 开启了 22 端口