某些 ssh 版本默认禁止远程登录 root 账户。

1、编辑/etc/ssh/sshd_config文件

vim /etc/ssh/sshd_config

2、新增一行:允许 root 账户远程登录,:wq保存退出。

PermitRootLogin yes

3、重启 ssh 服务(或重启 Linux 服务器)

/etc/init.d/ssh restart

更多推荐

Linux允许root账户远程ssh登录