Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa(解决的两种方式)

简介: Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa(解决的两种方式)

异常问题:

  下班之前升级了一下Git的版本,结果第二天过来拉取远程最新代码的时候就提示了下面的异常问题:

Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa
Git failed with a fatal error.
Git failed with a fatal error.
Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

问题分析:

  通过翻译上面的报错信息大概说的是没有匹配到类型为ssh-rsa的主机秘钥。或者是可能你的代码仓库权限没有了。

于是我上代码托管平台看了下我的项目权限是否被修改了,结果发现没有变更(这个可能性别排除了)。然后既然是ssh-rsa秘钥的问题,我就是试着把本机的ssh-key重生生成了一次再去托管平台添加,然后依旧还是包这个错。

解决方案一,切换成HTTPS的方式

1、修改本地代码关联的远程地址

git remote set-url origin https://gitee.com/ysgdaydayup/pingrixuexilianxi.git

2、重新拉取成功 

git pulll

解决方案二、在.ssh文件中创建config文件并添加配置 

添加如下匹配:

第一行说明对所有主机生效,当然你也可以指定对应主机地址!

Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

1336199-20220405020430060-1947629875.png

1336199-20220405020448846-1734701482.png

相关文章
|
22天前
|
Linux 网络安全 数据安全/隐私保护
Jun 03 14:50:45 nodeName sshd[60215]: Accepted password for root from 192.168.0.100 port 15612 ssh2 如何关闭这个连接
【6月更文挑战第6天】Jun 03 14:50:45 nodeName sshd[60215]: Accepted password for root from 192.168.0.100 port 15612 ssh2 如何关闭这个连接
18 2
|
1月前
|
安全 网络安全
jsch 报错 no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha> 如何处理
【5月更文挑战第24天】jsch 报错 no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha> 如何处理
67 1
|
1月前
|
安全 网络安全
jsch 报错 no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha>问题处理方法
【5月更文挑战第10天】jsch 报错 no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha>问题处理方法
129 0
|
1月前
|
算法 网络安全
no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha> 问题解决
【5月更文挑战第8天】no matching host key type found. Their offer: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha> 问题解决
40 0
|
安全 Shell 网络安全
SSH key -本地与远程中央仓库连接认证
SSH key -本地与远程中央仓库连接认证
SSH key -本地与远程中央仓库连接认证
|
网络安全 数据安全/隐私保护 Linux
|
安全 网络安全 数据安全/隐私保护
|
1天前
|
安全 Linux Shell
Linux中SSH命令介绍
Linux中SSH命令介绍
14 2
|
1天前
|
网络协议 Linux 网络安全
Linux配置SSH允许TCP转发
Linux配置SSH允许TCP转发
8 1
|
6天前
|
安全 Linux Shell
【Linux基础】SSH登录
安全外壳协议(Secure Shell Protocol,简称SSH)是一种加密的网络传输协议,可在不安全的网络中为网络服务提供安全的传输环境。 SSH通过在网络中建立安全隧道来实现SSH客户端与服务器之间的连接。 SSH最常见的用途是远程登录系统,人们通常利用SSH来传输命令行界面和远程执行命令。
20 6