ssh版本升级后ssh或者sftp连接失败的处理方法

一、问题描述

原来的ssh版本是5.3,

ssh -V

OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010

升级以后的版本是7.4

OpenSSH_7.4p1, OpenSSL 1.0.1u 22 Sep 2016

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

二、解决办法

vi /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




  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值