先用命令进入到 cd /etc/ssh ssh目录
打开vim ssh_config
找到其中 # PasswordAuthentication no 去掉其注释,并将no改为yes,然后输入:wq进行保存
用命令vim sshd_config 进入修改配置文件 sshd_config
将PermitRootLogin prohibit-password和PasswordAuthentication no 去掉其注释,并将no改为yes,然后输入:wq进行保存
开启ssh服务
service ssh start
查看是否开启ssh服务
service ssh status
设置ssh服务开机自启
update-rc.d ssh enable
尝试连接