Ubuntu无法连接ssh


1、使用vim命令打开/etc/ssh/sshd_config

      # vim /etc/ssh/sshd_config

      在文本的最后添加

    

Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc

MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,hmac-sha1-96,hmac-md5-96

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-
[email protected]

2、在配置文件中找到下面这段代码,修改如下。

# Authentication:
LoginGraceTime 120
#PermitRootLogin prohibit-password
PermitRootLogin yes
StrictModes yes

3、使用/etc/init.d/ssh restart命令重启ssh服务,ssh就可以连接上了。

猜你喜欢

转载自blog.csdn.net/weixin_42462202/article/details/82686053