博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
存储库访问被拒绝。通过部署密钥进行访问是只读的
阅读量:2292 次
发布时间:2019-05-09

本文共 5250 字,大约阅读时间需要 17 分钟。

本文翻译自:

After successfully cloning my repo from heroku and added another remote 成功克隆了来自heroku的repo并添加了另一个遥控器

1/ git clone git@heroku.com:[APP].git2/ git remote add bitbucket ssh://git@bitbucket.org/[ACCOUNT]/[REPO].git3/ git push bitbucket master

I am still getting this error after running line (3) or using SourceTree 运行第(3)行或使用SourceTree后,我仍然收到此错误

conq: repository access denied. access via a deployment key is read-only.

First I don't understand what this message means in practice. 首先,我不明白这个消息在实践中意味着什么。 And that's shame. 这太可惜了。

I did create ssh key pair and added to heroku : 我确实创建了ssh密钥对并添加到heroku:

ssh-keygen -t rsa heroku keys:add ./id_rsa.pub

I also added my key in deployment keys section in BitBucket. 我还在BitBucket中的部署密钥部分添加了我的密钥。 But I must be missing something. 但我必须遗漏一些东西。 This question is not out of laziness, I have been reading various docs including BitBuckets guides. 这个问题并非出于懒惰,我一直在阅读各种文档,包括BitBuckets指南。 But it still don't get around this issue. 但它仍然无法解决这个问题。

This post is related to 这篇文章与

ADDITIONAL FACTS: 其他事实:

ssh -T hg@bitbucket.orgconq: authenticated via a deploy key.You can use git or hg to connect to Bitbucket. Shell access is disabled.$ ssh -v git@bitbucket.orgOpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011debug1: Reading configuration data /Users/joel/.ssh/configdebug1: Applying options for bitbucket.orgdebug1: Reading configuration data /etc/ssh_configdebug1: Applying options for *debug1: Connecting to bitbucket.org [207.223.240.181] port 22.debug1: Connection established.debug1: identity file /Users/joel/.ssh/id_rsa type 1debug1: identity file /Users/joel/.ssh/id_rsa-cert type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3debug1: match: OpenSSH_5.3 pat OpenSSH*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.6debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdebug1: SSH2_MSG_KEX_DH_GEX_INIT sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdebug1: Host 'bitbucket.org' is known and matches the RSA host key.debug1: Found key in /Users/joel/.ssh/known_hosts:5debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: Roaming not allowed by serverdebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Offering RSA public key: /Users/joel/.ssh/id_rsadebug1: Remote: Forced command: conq deploykey:13907debug1: Remote: Port forwarding disabled.debug1: Remote: X11 forwarding disabled.debug1: Remote: Agent forwarding disabled.debug1: Remote: Pty allocation disabled.debug1: Server accepts key: pkalg ssh-rsa blen 279debug1: read PEM private key done: type RSAdebug1: Remote: Forced command: conq deploykey:13907debug1: Remote: Port forwarding disabled.debug1: Remote: X11 forwarding disabled.debug1: Remote: Agent forwarding disabled.debug1: Remote: Pty allocation disabled.debug1: Authentication succeeded (publickey).Authenticated to bitbucket.org ([207.223.240.181]:22).debug1: channel 0: new [client-session]debug1: Requesting no-more-sessions@openssh.comdebug1: Entering interactive session.debug1: Sending environment.debug1: Sending env LC_CTYPE = UTF-8PTY allocation request failed on channel 0

Looks like all is fine. 看起来一切都很好。


#1楼

参考:


#2楼

First confusion on my side was about where exactly to set SSH Keys in BitBucket. 我身边的第一个困惑是关于在BitBucket中设置SSH密钥的确切位置。

I am new to BitBucket and I was setting a Deployment Key which gives read-access only. 我是BitBucket的新手,我正在设置一个仅提供读访问权限部署密钥

So make sure you are setting your rsa pub key in your BitBucket Account Settings . 因此,请确保在BitBucket帐户设置中设置rsa pub key

Click your BitBucket avatar and select Bitbucket Settings ( 单击您的BitBucket头像并选择Bitbucket设置 Manage account 管理帐户 ). )。 There you'll be able to set SSH Keys . 在那里,您将能够设置SSH密钥

I simply deleted the Deployment Key , I don't need any for now. 我只是删除了部署密钥 ,我现在不需要。 And it worked 它奏效了


#3楼

如果要在“管理帐户SSH密钥”下添加相同的密钥,则必须先删除部署密钥。


#4楼

All you need - add another key and use it. 所需的一切 - 添加另一个密钥并使用它。

As i've found first key - always Deployment Key. 因为我找到了第一个密钥 - 总是部署密钥。


#5楼

I had this happen when I was trying to use a deployment key because that is exactly what I wanted. 当我尝试使用部署密钥时,我发生了这种情况,因为这正是我想要的。

I could connect via ssh -T git@bitbucket.org and it would tell me I had access to read the repository I wanted, but git clone would fail. 我可以通过ssh -T git@bitbucket.org连接,它会告诉我我有权读取我想要的存储库,但是git clone会失败。

Clearing out ~/.ssh/known_hosts , generating a new key via ssh-keygen , adding that new key to bitbucket, and retrying fixed it for me. 清除~/.ssh/known_hosts ,通过ssh-keygen生成一个新密钥,将新密钥添加到bitbucket,然后重试为我修复它。


#6楼

I had the same issue Kabir Sarin had. 我有同样的问题Kabir Sarin。 The solution was to clone the repo via SSH, instead of using the https URL. 解决方案是通过SSH克隆repo,而不是使用https URL。 so this is what helped me, and hopefully others: 所以这对我有所帮助,希望其他人:

git clone git@bitbucket.org:{accountName}/{repoName}.git

转载地址:http://dgcnb.baihongyu.com/

你可能感兴趣的文章