错误:克隆项目表单位存储桶时出现“连接已关闭...”

时间:2019-05-18 12:06:32

标签: git ssh bitbucket

我最近无法连接到Bitbucket。例如,当我想连接到GitHub时没有问题。但是,当我要克隆项目时,出现此错误:

Connection closed by 18.205.93.1 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我100%确定我具有访问权限,并且该存储库存在。我创建了许多不同的密钥,并将它们也放入了我的位桶中,但是它什么都没有改变。我运行此ssh -v git@bitbucket.org以获取更多信息。这是我看到的:

OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Connecting to bitbucket.org [18.205.93.2] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\nipek/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
...
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
...
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:zzXQOX...
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in C:\\Users\\nipek/.ssh/known_hosts:3
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:M7dEqyz... C:\\Users\\nipek/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([18.205.93.2]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: console supports the ansi parsing
PTY allocation request failed on channel 0
logged in as LukNie.

You can use git or hg to connect to Bitbucket. Shell access is disabled.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to bitbucket.org closed.
Transferred: sent 2732, received 1852 bytes, in 0.3 seconds
Bytes per second: sent 9222.4, received 6251.8
debug1: Exit status 0

我最近在系统上遇到问题,并且由于系统的一部分“恢复为初始设置”而丢失了一些文件。我想知道文件之间是否存在一些配置错误,这就是原因,但是我不知道如何解决它。

1 个答案:

答案 0 :(得分:0)

我找到了解决方法。这不是一个完美的解决方案,但至少可以奏效。这是“如果端口22被阻止”下的说明https://confluence.atlassian.com/bitbucket/troubleshoot-ssh-issues-271943403.html。通常,如果端口22出现问题,可以使用端口443,如下所示:

git clone ssh://git@altssh.bitbucket.org:443/<account_name>/<repo_name>/