Ubuntu SSH 失败

1、Ubuntu 需要安装SSH服务器

sudo apt-get install openssh-server

2、启用root用户

sudo passwd -u root #解锁密码

sudo passwd root #设置密码

3、开启ssh下root登录

修改配置文件sshd_config中,进行编辑:vi /etc/ssh/sshd_config

找到PermitRootLogin 添加一行 PermitRootLogin yes,如下:

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes

保存退出后,重启ssh服务,输入命令: /etc/init.d/ssh restart

原文地址:https://www.cnblogs.com/m2492565210/p/15474655.html