使用远程工具SSH Secure连接ubuntu时遇到问题“ server responded “algorithm negotiation failed”“解决办法!

我使用的是ubuntu server 20,在使用远程连接工具SSH Secure连接ubuntu时报出错误“server responded "algorithm negotiation failed”,
在这里插入图片描述

在网上搜了这个问题,发现解决方式都是输入命令
sudo 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,umac-64@openssh.com,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-sha256@libssh.org
然后输入命令
sudo /etc/init.d/ssh restart
重启ssh,但是,我按照步骤这样做,重启ssh时,就会报错
在这里插入图片描述
说明这样做不适合我所遇到的问题。经过摸索之后,用以下方法就可解决远程连接出错问题,所以在这做个记录。
同样输入命令,
sudo vim /etc/ssh/sshd_config
进入sshd_config
将PermitRootLogin前面的“#”去掉,并且后面改成“yes”
在这里插入图片描述

在sshd_config文件后面输入以下内容(注意:对于不太了解linux命令的同学来说,可能不太懂vim,这里输入以下内容时,要先按‘i’,才可以输入内容)
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com
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-sha256@libssh.org
输入完之后,按“ESC”再按“ :wq ”,退出编辑页面,在输入命令
sudo /etc/init.d/ssh restart重启ssh.
在这里插入图片描述
重启成功之后,使用远程连接工具便可以连接成功。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值