我在Stack Overflow上看到过很多类似的问题,但是在尝试了所有步骤之后我已经用尽了一些东西。希望别人能发现一些东西。这是我尝试过的(这适用于Mac):
id_bbu
id_bbu.pub
添加到我的Bitbucket帐户(我绝对没有添加任何内容作为部署密钥)ssh-agent
。当我运行ssh-add -l
时,我会显示3个键:id_bbu
,id_rsa
,id_git
~/.ssh/config
文件其中包括:
host IBM github
hostName gain-github.com
IdentityFile ~/.ssh/id_rsa
host github.com
hostName github.com
IdentityFile ~/.ssh/id_git
Host bitbucket.org
IdentityFile ~/.ssh/id_bbu
PreferredAuthentications publickey
ssh -Tv git@bitbucket.org
的输出如下(实际值已更改)OpenSSH_6.2p2,OSSLShim 0.9.8r 2011年12月8日
debug1: Reading configuration data /Users/me/.ssh/config
debug1: /Users/me/.ssh/config line 9: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to bitbucket.org [104.192.456.2] port 22.
debug1: Connection established.
debug1: identity file /Users/me/.ssh/id_bbu type 1
debug1: identity file /Users/me/.ssh/id_bbu-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version conker_1.0.210.0xhgg76
debug1: no match: conker_1.0.210.0xhgg76
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client afd128-ctr hmac-sha1 none
debug1: kex: client->server afd128-ctr hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 97:8c:2f:f5:7u:45:6v:5c:3b:ec:aa:46:49:76:6y:40
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /Users/me/.ssh/known_hosts:9
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: /Users/me/.ssh/id_bbu
debug1: Server accepts key: pkalg ssh-rsa blen 542
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([124.183.124.2]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
logged in as myusername.
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
Transferred: sent 3896, received 2208 bytes, in 0.2 seconds
Bytes per second: sent 21554.4, received 12215.6
debug1: Exit status 0
git push -u origin --all
我明白了:
conq: repository access denied.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
我尝试删除存储库并创建一个新存储库。我也尝试删除这些密钥并生成一个具有不同名称的新对。
以防万一造成问题,
这是我的项目的.git / config文件:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = git@bitbucket.org:myaccount/my-repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
我可以尝试的任何其他内容或上述任何明显的东西吗?
由于