ssh连接不成功

SSH升级到7.4后,导致与旧版服务器的连接失败,出现Algorithm negotiation fail等错误。解决方法是在sshd_config文件中添加特定的MAC和KexAlgorithms配置,以兼容旧版本。
摘要由CSDN通过智能技术生成

ssh连接不成功

一、问题描述

  1. 输入:ssh -V,查看版本。(原来的ssh版本是5.3)
    OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
  2. 升级以后的版本是7.4
    OpenSSH_7.4p1, OpenSSL 1.0.1u 22 Sep 2016

ssh升级以后,服务器原来的代码都连接不上sftp,出现Algorithm negotiation fail SSH in Jenkins等问题,用python写了一个paramiko的测试程序也出现问题,可以确认是安全级别的问题。

解决方案

找到ssh的配置文件:vim /etc/ssh/sshd_config,在文件尾加入下面的配置:

MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com,hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值