【问题标题】:fatal: Could not read from repository致命:无法从存储库中读取
【发布时间】:2015-01-07 11:58:45
【问题描述】:

因此,在我之前的笔记本电脑死机后,我得到了一台新笔记本电脑 - 我现在正试图推送到 Bitbucket 上的存储库,但遇到了许多错误。在 Bitbucket 上设置 SSH 的所有指南似乎都与 Git Bash 相关——我正在运行 Git Shell,其中一些命令返回了很多错误。以下是我一直看到但不知道如何处理的一些错误:

C:\Users\Tai\Desktop\SYCS136 [master]> git push origin master
Warning: Permanently added 'bitbucket.org,131.103.20.167' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

C:\Users\Tai\Desktop\SYCS136 [master]> ssh -T hg@bitbucket.org
Warning: Permanently added 'bitbucket.org,131.103.20.167' (RSA) to the list of known hosts.
Permission denied (publickey).


C:\Users\Tai\Desktop\SYCS136 [master]> ssh -v hg@bitbucket.org
OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 1: Applying options for *
debug1: Connecting to bitbucket.org [131.103.20.167] port 22.
debug1: Connection established.
debug1: identity file /c/Users/Tai/.ssh/id_rsa type 1
debug1: identity file /c/Users/Tai/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/Tai/.ssh/id_dsa type -1
debug1: identity file /c/Users/Tai/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/Tai/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/Tai/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/Tai/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/Tai/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40
Warning: Permanently added 'bitbucket.org,131.103.20.167' (RSA) to the list of k
nown hosts.
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/Tai/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/Tai/.ssh/id_dsa
debug1: Trying private key: /c/Users/Tai/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/Tai/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

C:\Users\Tai\Desktop\SYCS136 [master]> ps -e | grep [s]sh-agent
Get-Process : Parameter cannot be processed because the parameter name 'e' is ambiguous. Possible matches include: -ErrorAction -ErrorVariable.
At line:1 char:3
+ ps <<<<  -e | grep [s]sh-agent
    + CategoryInfo          : InvalidArgument: (:) [Get-Process], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameter,Microsoft.PowerShell.Commands.GetProcessCommand

我是否可以查看其他指南来解决此问题,或者我缺少什么?

【问题讨论】:

  • 您的密钥被服务器拒绝。您需要修复您的 bitbucket 帐户上的授权密钥。
  • 您似乎没有将旧机器上的 SSH 密钥转移到新机器上?如果您丢失了密钥,则需要在服务器端添加它们。
  • @JohnZwinck 所以我必须简单地创建新的?我没有旧笔记本电脑了,我应该删除旧笔记本电脑吗?

标签: git bash bitbucket


【解决方案1】:

听起来您丢失了旧机器上的 SSH 密钥(下次您应该将它们备份到安全的地方)。您的新机器已经有一个 SSH 密钥对,它与旧机器不同,因此您需要在 BitBucket 上更新您的授权密钥。

【讨论】:

    猜你喜欢
    • 2015-10-31
    • 2015-01-19
    • 2012-11-10
    • 2020-09-14
    • 1970-01-01
    • 1970-01-01
    • 2018-03-06
    • 2019-10-24
    • 2022-06-11
    相关资源
    最近更新 更多