gpt4 book ai didi

git - 使用 git/bitbucket 突然开始收到 ssh_exchange_identification 错误

转载 作者:行者123 更新时间:2023-12-05 03:55:07 24 4
gpt4 key购买 nike

系统中没有任何更改。我像往常一样工作。通常 pull/推没有任何问题。如果我通过浏览器访问它,我可以访问 bitbucket。

现在,当我尝试从 bitbucket 存储库中推送或 pull 时,出现错误:

ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

下面是一个带有详细输出的命令,但我不明白问题出在哪里。

用于详细输出的命令:$ GIT_SSH_COMMAND="ssh -vvv"git pull

输出:

OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/volk/.ssh/config
debug1: /Users/volk/.ssh/config line 48: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolving "bitbucket.org" port 22
debug2: ssh_connect_direct
debug1: Connecting to bitbucket.org [18.205.93.2] port 22.
debug1: Connection established.
debug1: identity file /Users/volk/.ssh/id_rsa type 0
debug1: identity file /Users/volk/.ssh/id_rsa-cert type -1
debug1: identity file /Users/volk/.ssh/id_dsa type -1
debug1: identity file /Users/volk/.ssh/id_dsa-cert type -1
debug1: identity file /Users/volk/.ssh/id_ecdsa type -1
debug1: identity file /Users/volk/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/volk/.ssh/id_ed25519 type -1
debug1: identity file /Users/volk/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/volk/.ssh/id_xmss type -1
debug1: identity file /Users/volk/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

最佳答案

今天遇到同样的问题。

通过在 ssh config(vim ~/.ssh/config) 中添加以下行解决了这个问题

Host bitbucket.org
AddKeysToAgent yes
HostName altssh.bitbucket.org
IdentityFile ~/.ssh/id_rsa
UseKeychain yes
Port 443

关于git - 使用 git/bitbucket 突然开始收到 ssh_exchange_identification 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60440635/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com