解决ssh: no common algorithm for key exchange; client offered: [curve25519-sha256@libssh.org ecdh
报错如下
ssh: no common algorithm for key exchange; client offered: [curve25519-sha256@libssh.org ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 diffie-hellman-group14-sha1], server offered: [diffie-hellman-group-exchange-sha256]
基于SSH连接时报的错
报错时的代码:
var clientConfig *ssh.ClientConfigclientConfig = &ssh.ClientConfig{User: c.Username,Auth: auth,Timeout: 10 * time.Second,HostKeyCallback: ssh.InsecureIgnoreHostKey(), }sshClient := new(ssh.Client)if sshClient, err = ssh.Dial("tcp", fmt.Sprintf("%s:%d", c.Host, c.Port), clientConfig); err != nil {return}
解决其实很简单
要指定好"diffie-hellman-group-exchange-sha256"算法,就是报错中提到的;
成功的代码
var clientConfig *ssh.ClientConfigclientConfig = &ssh.ClientConfig{User: c.Username,Auth: auth,Timeout: 10 * time.Second,HostKeyCallback: ssh.InsecureIgnoreHostKey(), }clientConfig.KeyExchanges = append(clientConfig.KeyExchanges, "diffie-hellman-group-exchange-sha256")sshClient := new(ssh.Client)if sshClient, err = ssh.Dial("tcp", fmt.Sprintf("%s:%d", c.Host, c.Port), clientConfig); err != nil {return}
如果解决了你的问题,欢迎留下足迹哦!
解决ssh: no common algorithm for key exchange; client offered: [curve25519-sha256@libssh.org ecdh相关推荐
- ECDH 密钥交换举例(ECDH Key Exchange - Examples)
现在,让我们用Python实现ECDH算法(Elliptic Curve Diffie–Hellman Key Exchange). 我们将使用Python中用于ECC的tinyec库: pip in ...
- SecureCRT SSH 失败 Key exchange failed 解决方法
SecureCRT SSH 失败 Key exchange failed 解决方法 参考文章: (1)SecureCRT SSH 失败 Key exchange failed 解决方法 (2)http ...
- 解决 tabby 登录远程时报错:Handshake failed: no matching key exchange algorithm
tabby 登录远程时报错:Handshake failed: no matching key exchange algorithm 解决方法: 进入当前远程配置 切换到加密方法选项 把密钥交换中的选 ...
- 【ssh登陆问题】no matching cipher found / no matching key exchange method found
no matching cipher found / no matching key exchange method found 解决方法 修改ssh配置文件,添加相应设置即可 1.ssh 加密方法和 ...
- Navicat 用ssh通道连接时总是报错 (报错信息:SSH:expected key exchange group packet form serve...
转:https://blog.csdn.net/qq_27463323/article/details/76830731 之前下了一个Navicat 11.0 版本 用ssh通道连接时总是报错 (报错 ...
- ssh登录主机报错: Unable to negotiate with 172.222.222.243 port 22: no matching key exchange method found.
问题:ssh登录主机报错 ssh root@172.222.222.243 报错 #报错Unable to negotiate with 172.222.222.243 port 22: no mat ...
- ssh 连接报错:Unable to negotiate with 192.168.xx.xx port 22: no matching key exchange method found.
用 ssh 连接 Linux 服务器时,很偶然的情况下出现了如下报错: Unable to negotiate with xx.xx.xx.xx port 22: no matching key ex ...
- Key exchange was not finished, connection is closed.解决办法
错误 利用java连接Linux服务器中碰到错误:Key exchange was not finished, connection is closed.,导致服务器的连接失败,报错如下 原因 是ss ...
- navicat连接mysql报错ssh_Navicat 连接SSH方式连接mysql报错 ssh:expected key exchange group packet...
只需要在sshd配置文件中加入以下行即可: KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp3 ...
最新文章
- 基于自适应逆透视变换的车道线SLAM
- 实战Registry和RegistryKey类,一个简单的可疑文件扫描程序
- python不能加密吗_为什么我不能解密我用pycrypto加密的内容?
- dede织梦调用顶级二级栏目及下三级栏目方法(数据库实现)
- android 上下滚动文字_计算机毕设项目004之Android系统在线小说阅读器
- linux 动态传参执行shell脚本
- pandas切片操作
- mysql创建索引以及进程过程中出现的问题
- 显式强制类型转换static_cast, dynamic_cast, const_cast, reinterpret_cast
- fedora22有时不能启动
- weka特征选择源码阅读
- [NLP论文阅读]A SIMPLE BUT TOUGH-TO-BEAT BASELINE FOR SENTENCE EMBEDDINGS
- Unity3D VS UE4
- 求101到150之间的质数
- scratch 编程 镜像画
- tp6/thinkphp6实现微信小程序支付/微信支付v3版本,全部流程代码
- Mongodb 按照时间进行分组统计查询
- 如何使用KALI攻击“恶意网站“实验
- 为什么越来越多的绘图员开始用云渲染来渲图?
- yyds、yygq、xswl...都是什么意思?