repository access denied

Hi - I am getting the following error now to a repo I used to be able to push to:

```

Pushing to git@bitbucket.org:digitalpulp/cornell.git
conq: repository access denied.
fatal: Could not read from remote repository.

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

````

 

I even created a separate public key for bitbucket vs git, which didn't fix the issue. This is my .ssh/config:

```

# Default GitHub user

Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

# Bitbucket
Host bitbucket.org
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/bitbucket

```

I followed all of the instructions here:

https://confluence.atlassian.com/pages/viewpage.action?pageId=271943168&continue=https%3A%2F%2Fconfluence.atlassian.com%2Fpages%2Fviewpage.action%3FpageId%3D271943168&application=cac

 

And added my public keys to the repo.

 

I ran:

```

ssh -Tv git@bitbucket.org.

````

This was the output:

````

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/[USER]/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to bitbucket.org [131.103.20.167] port 22.
debug1: Connection established.
debug1: identity file /Users/[USER]/.ssh/bitbucket type 1
debug1: identity file /Users/[USER]/.ssh/bitbucket-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 OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5*
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<1024<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
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /Users/[USER]/.ssh/known_hosts:13
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/[USER]/.ssh/bitbucket
debug1: Remote: Forced command: conq username:[USER]
debug1: 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 279
debug1: Remote: Forced command: conq username:[USER]
debug1: 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 ([131.103.20.167]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
logged in as [USER].

 

Any ideas what to try next? Pushing to this repo used to work for me...

4 answers

0 votes
Boris Berenberg Community Champion Dec 29, 2014

Do you have access to the repo via the WebUI?

I have same issue: ssh verbose shows that

debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([IP]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_TIME = uk_UA.UTF-8
debug1: Sending env LC_MONETARY = uk_UA.UTF-8
debug1: Sending env LC_ADDRESS = uk_UA.UTF-8
debug1: Sending env LC_TELEPHONE = uk_UA.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_NAME = uk_UA.UTF-8
debug1: Sending env LC_MEASUREMENT = uk_UA.UTF-8
debug1: Sending env LC_IDENTIFICATION = uk_UA.UTF-8
debug1: Sending env LC_NUMERIC = uk_UA.UTF-8
debug1: Sending env LC_PAPER = uk_UA.UTF-8
debug1: Sending command: git-upload-pack '[user/repo.git]'
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
repository access denied.
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 3240, received 1648 bytes, in 0.3 seconds
Bytes per second: sent 10179.2, received 5177.6
debug1: Exit status 1
fatal: Could not read from remote repository.

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

Im the owner of that repo, and this log obtained while I tried to pull. And yes, I have access through web.  

FYI, git != github

What's the output of {{ssh git@bitbucket.org -Tv}} ?

I have the same issue.  Did you manage to resolve it?

Here's my output for "ssh git@bitbucket.org -Tv"

ssh git@bitbucket.org -Tv
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/jbkielis/.ssh/config
debug1: /Users/jbkielis/.ssh/config line 156: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.org [2401:1d80:1010::152] port 22.
debug1: Connection established.
debug1: identity file /Users/jbkielis/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jbkielis/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version conker_1.0.310-c404db1 app-155
debug1: no match: conker_1.0.310-c404db1 app-155
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /Users/jbkielis/.ssh/known_hosts:1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/jbkielis/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([2401:1d80:1010::152]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2712, received 1608 bytes, in 10.1 seconds
Bytes per second: sent 269.7, received 159.9
debug1: Exit status -1

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

631 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot