idea git 拉取代码 unable to negotiate whith 10.207.64.88 port 22:no matching host key type found their offer:ssh-rsa
时间: 2024-11-23 19:28:49 浏览: 89
当你在 IntelliJ IDEA 中尝试从远程 Git 服务器拉取代码时,遇到 "unable to negotiate with <IP地址>:port 22: no matching host key type found" 的错误,这通常是由于 SSH 客户端无法识别服务器提供的 SSH 公钥类型导致的。
原因可能是:
1. 本地 SSH 钥匙库未包含目标服务器的公钥信息。你需要确保本地有服务器的SSH公钥,或者手动添加它到你的 `~/.ssh/known_hosts` 文件中,以信任这个连接。
2. 如果这是第一次连接,IntelliJ 可能需要你确认是否接受该新主机的密钥。此时,你应该输入 `yes` 或按照提示操作。
3. 也有可能是服务器的公钥格式不匹配,你可以检查一下服务器配置,确保公钥设置正确,并且使用的加密算法(如 RSA、Ed25519 等)与客户端期望的一致。
解决这个问题的步骤一般包括:
1. 更新 `known_hosts` 文件:
```
ssh-keyscan -t rsa,ed25519 <IP地址> >> ~/.ssh/known_hosts
```
2. 在 IntelliJ IDEA 中手动导入公钥(如果可以的话):
- 设置 -> Version Control -> GitHub -> SSH
3. 确认并添加新主机密钥到信任列表。
4. 如果还是不行,可能需要联系服务器管理员更新他们的 SSH 密钥配置。
相关问题
Unable to negotiate with 106.52.160.162 port 22: no matching host key type found. Their offer: ssh-rsa
出"Unable to negotiate with 106.52.160.162 port 22: no matching host key type found. Their offer: ssh-rsa"的错误提示是因为Git找不到支持的密钥交换方法。新版Openssh中不再支持SHA1这种hash散列算法,需要手动允许对于SHA1的支持。
解决办法是在生成公钥的.ssh文件夹中,新建一个没有后缀的config文件,并在其中添加以下内容:
Host *
HostkeyAlgorithms ssh-rsa
PubkeyAcceptedKeyTypes ssh-rsa
保存后,再次使用git命令应该就能恢复正常啦。
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)