【Java】Ganymed-ssh2.jar包连接服务器报错(OpenSSH高版本)

写在前面
环境信息:
ganymed-ssh2-build210.jar
目标服务器openssh版本:
openssh 8.2p1

官方网站:
http://www.ganymed.ethz.ch/ssh2/
/etc/ssh/sshd_config 帮助手册(来自openBSD)

When an SSH client connects to a server, each side offers lists of connection parameters to the other. These are, with the corresponding ssh_config keyword:

  • KexAlgorithms: the key exchange methods that are used to generate per-connection keys
  • HostkeyAlgorithms: the public key algorithms accepted for an SSH server to authenticate itself to an - SSH client
  • Ciphers: the ciphers to encrypt the connection
  • MACs: the message authentication codes used to detect traffic modification

摘自:OpenSSH Legacy Options

一、ganymed-ssh2支持的算法如下:

MACs
在这里插入图片描述
BlickCipherFactory
在这里插入图片描述
KexAlgrithms
在这里插入图片描述

二、openssh 8.2p1 /etc/ssh/sshd_config配置信息如下:

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com

MACs hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com,hmac-sha1,hmac-sha1-etm@openssh.com

KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256

上述配置信息中:
MACs中未包含Ganymed-ssh2.jar所实现的算法,因此需要在配置中补充声明相关算法。

MACs hmac-sha1-96,hmac-sha1,hmac-md5-96,hmac-md5,hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com,hmac-sha1,hmac-sha1-etm@openssh.com

当发现使用Ganymed-ssh2.jar连接服务出现校验错误时,检查sshd配置,增加相关算法的声明即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值