git - 错误:克隆项目表单 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% 确定我有访问权限并且存储库存在。我创建了许多不同的密钥并将其放入我的 bitbucket 中,但它并没有改变任何东西。我运行它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
最近我的系统出现问题,我丢失了一些文件,因为我的系统的一部分“恢复到初始设置”。我想知道文件之间是否存在一些错误配置,这就是原因,但是我不知道如何修复它。
解决方案
我找到了一种解决方法。这不是一个完美的解决方案,但至少它有效。这是“如果端口 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>/
推荐阅读
- javascript - 使用 json 的 Bootstrap 4 导航栏
- python - 为什么每当我“播放”音乐时,python 都会播放奇怪的声音?
- c++ - 如何将 qprocess 带到最前面?
- mysql - MySQLdb._exceptions.ProgrammingError: (1064, "你的 SQL 语法有错误)
- java - 按下回车后,JLine 自动完成不显示并运行 onComplete
- r - 为什么 Rstudio 找不到 libRblas.so 和 libRlapack.so,或者应该如何在 Ubuntu 18 中安装它们?
- c++ - 如何使用 ncurses 库在 c++ for mac 中打印特殊字符
- windows - 将文件创建为“file.ext:file.ext”的真正作用是什么?
- android - Parcelable 可以包含 AIDL 接口吗?
- python - 我如何调用此方法进行调试?