You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I am going today through connectivity problems to my bitbucket repositories. It does not seem a client issue as I can reproduce the same problem in my two machines. Neither an internet connection problem on my side, as I can reproduce through two different networks (home connection and cell phone tethering).
The sympthoms are as follow:
$ git pull
Enter passphrase for key '/home/roberto/.ssh/id_bitbucket':
Connection to bitbucket.org closed by remote host.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Same exact message in both machines. I have tried the following also:
$ ssh -v git@bitbucket.org
OpenSSH_7.6p1 Ubuntu-4ubuntu0.1, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /home/roberto/.ssh/config
debug1: /home/roberto/.ssh/config line 1: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to bitbucket.org [18.205.93.2] port 22.
debug1: Connection established.
debug1: identity file /home/roberto/.ssh/id_bitbucket type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/roberto/.ssh/id_bitbucket-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.1
debug1: Remote protocol version 2.0, remote software version conker_1.1.17-9953920 app-130
debug1: no match: conker_1.1.17-9953920 app-130
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: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> 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 /home/roberto/.ssh/known_hosts:31
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: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:KwjrafCTA0P4mDiNqNztGEmmYkpdcGN633rHnL81AEM /home/roberto/.ssh/id_bitbucket
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: Sending environment.
debug1: Sending env LC_MEASUREMENT = es_ES.UTF-8
debug1: Sending env LC_PAPER = es_ES.UTF-8
debug1: Sending env LC_MONETARY = es_ES.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_NAME = es_ES.UTF-8
debug1: Sending env LC_ADDRESS = es_ES.UTF-8
debug1: Sending env LC_NUMERIC = es_ES.UTF-8
debug1: Sending env LC_TELEPHONE = es_ES.UTF-8
debug1: Sending env LC_IDENTIFICATION = es_ES.UTF-8
debug1: Sending env LC_TIME = es_ES.UTF-8
debug1: channel 0: free: client-session, nchannels 1
Connection to bitbucket.org closed by remote host.
Connection to bitbucket.org closed.
Transferred: sent 3468, received 1640 bytes, in 20.1 seconds
Bytes per second: sent 172.4, received 81.5
debug1: Exit status -1
I do not know how to continue from this point. Any hints?
Thanks in advance.
Community moderators have prevented the ability to post new answers.
Today this problem just disappeared from all my devices. I am able to pull, push, clone, etc. without problem. Flush! Server side problem + fix, I guess. That's fine.
BUT
How does Atlassian ever want to make the community engaged with their products with such service bumps? Two weeks! I even had to create a git server at home to be able to continue work. I am sure that I was not the only one with this problem, my setup is simple (standard git + openssh).
The worst part was the feeling that nobody really cared about this issue. That I would not even be able to clone my git repos (and maybe move somewhere else).
Thank you for the fix, but my trust on bitbucket has got much weaker after this issue.
I'm facing a similar issue, since days :(
I'm working now with newly generated ssh-keys
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I’m having the same problem right now, also for days. I was working along just fine with my repository. A little more than a week ago, it stopped working. I got a notice from Atlassian that bitbucket was having problems. The next day, my repository was working fine again. A couple days after that, it stopped working again (no notice this time). It’s been several days now, and I still can’t write to [edit: or read from] my repository.
As robertolo surmised, this is probably a server side error.
Mark
Update: I did as Scott Dudley _Cenote_ suggested (below) and installed new SSH keys. This did not solve the problem. However, in troubleshooting, I did discover that the command
ssh -T git@bitbucket.org
Produced the error “Connection closed by [IP address] port 22” whenever I was connected to my VPN (specifically, NordVPN). When I was not connected to my VPN, the command produced the expected output indicating I was logged in by my username. Thus, I can conclude my SSH keys are now working properly.
However, attempts to push my code updates, even when my VPN is disconnected, produce the error message, “Connection to bitbucket.org closed by remote host. fatal: the remote end hung up unexpectedly”
I’ll keep updating here until resolved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At least in the situation where there is a "broken pipe" error message like this:
Cloning into 'reponame'...
packet_write_wait: Connection to a.b.c.d port 7089: Broken pipe
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I was able to get this to work by adding the following to the ~/.ssh/config file on the client machine:
IPQoS=throughput
For what it is worth, the client was a VM guest. For some of the other people that experienced issues only when using/not using a VPN, maybe this might be relevant too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! I'm in a VM too. This worked for me:
export GIT_SSH_COMMAND="ssh -o IPQoS=throughput -i /home/USERNAME/.ssh/id_rsa_bitbucket"
git clone ssh://USERNAME@bitbucket.org/WORKSPACE/REPO.git
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This happens because the SSH key needs to be addressed to the user account, not the repository itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't think this is the issue. `ssh -Tv git@bitbucket.org` show that SSH Auth actually works. Something else is preventing further communication.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I made this screenshot for a collaborator. This is really easy to do incorrectly. I'd argue the "incorrect" path is easier and more in your face when you create a new repository than the "correct" location. Hope this helps someone.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not. As @mkochco is pointing out, SSH authentication is actually working. It is something else which causes this error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @umassthrower !!!
I literally searched for hours to solve this problem and you gave an incredibly detailed visual guide on how to resolve the problem. It's specific to the UI of this platform and I'm not sure why this has not been addressed, but thank you so much for your contribution!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. FYI: adding the key to repository works in read mode, i was able to pull changes, but wasn't able to push
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Foi a solução perfeita, a chave ser informada no meu perfil e não no repositório.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @umassthrower for the detailed screenshot. I was looking for a solution and found the straight answer here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @umassthrower
For me this is a bug, where you can read for clone but no for push, or the log could be better. in my case
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @umassthrower for your answer, I managed to solve it.
Who knew, two and a half years later, the UI is still misleading. Atlassian in a nutshell I guess :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This way machine will have your main user full access to all your repos...! are you really advices that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I resolved with this simple trick
(found on StackOverflow: https://stackoverflow.com/questions/56828685/cant-git-push-to-bitbucket-unauthorized-fatal-could-not-read-from-remote-re/56828686#56828686).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Marcello Verona Thank you very much! Your answer solved my read-only error when trying to push to my bitbucket repo. I did infact save my public key in my repo's "Access key" setting, rather than my bitbucket account's "SSH key" settings. Deleting the key from the Access key and pasting it to SSH key settings resolved this issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
unfortunately, in my case the problem persists with *no* keys on the repo but keys on the account; in fact the repo never had keys at all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
None of this interface is available anymore. Where would I go to get my SSH keys to work for BitBucket now that the interface has changed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This way machine will have your main user full access to all your repos...! are you really advices that.. I can not believe people can advice that!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roberto!
Is your SSH correctly added to your SSH agent? You can check that by running the following command on your terminal:
ssh-add -L
If your key is not there, you can add it by doing:
ssh-add <path_to_key>
If your key is there, you can check if it's associated to the right Bitbucket account by running:
ssh -Tv git@bitbucket.org
If all the above seems to be ok, can you try to pull over https instead of ssh and tell us if you till get an error?
Let us know!
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So this command
ssh -Tv git@bitbucket.org
Gives me:
logged in as benwinding
But trying to pull a repository, gives me
Please make sure you have the correct access rights
and the repository exists.
Any ideas?...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am still facing the issue.
I run the commands which you mentioned above and i am able to add the keys to SSH agent but still getting below error. while i am pushing the code.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI the ssh -T command mentioned here is misleading!
As long as you have an ssh key configured on your Bitbucket account https://bitbucket.org/account/settings/ssh-keys/, the following command will report success, no matter the key that you're using to connect to BitBucket
$ ssh -Tv git@bitbucket.org
...
...
debug1: Authentication succeeded (publickey)
...
...
I tried two different ~/.ssh/config configurations to verify this. One with the actual key that I have configured in https://bitbucket.org/account/settings/ssh-keys/
Host bitbucket.org
HostName bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa_bitbucket
The ssh command returns "Authentication succeeded" and error code 0.
Then I changed the BitBucket section in my ~/.ssh/config to use a key that exists on my file system, but is not configured here https://bitbucket.org/account/settings/ssh-keys/
Host bitbucket.org
HostName bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa
...and the ssh command still returns "Authentication succeeded" and error code 0.
¯\_(ツ)_/¯
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me:
~/.ssh/config
Host bitbucket.org
Hostname bitbucket.org
User git
IdentityFile ~/.ssh/bitbucket_id_rsa
IdentitiesOnly yes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is what worked for me as it bypassed my agent forwarding and forced me to have the key local to the box. Not ideal, but it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah finally, after days of struggling with this issue, this solution works. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We experienced this issue and finally tracked it down to an issue with IP QoS settings. I don't think this has anything to do with Bitbucket. Instead it has everything to do with the route you take to Bitbucket and how the default SSH client IP QoS exposes issues with certain network equipment. We worked around the issues by adding the following to `/etc/sshd/ssh_config`
Host *
IPQoS 0x00
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very good, thanks - first reasonable answer in the whole thread. Unfortunately I cannot check this any more, I hope this could help others.
I have read somewhere else, that `IPQoS=throughput` can be also helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Has this been solved yet Atlassian ? - this is a really hard to troubleshoot problem.
The SSH connection is fine, nothing is wrong with the keys (it accepts public key auth), please tell us why this is failing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess they know from the beginning, from time to time they have such service (long) hiccups.
My original question dates from over a year ago.
Apparently they just do not give a shit about free tier users. They don't realize that these free tier users could potentially become paying customers, and they are just building a very bad reputation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The thing is - this doesn't just affect free tier users - this is effecting a bitbucket DC user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Me too experiencing this issue now.
2 weeks ago everything worked, now it's broken. What the hell?
Didn't change my keys, debug recognizes me correctly, yet i still can't pull or push to same repository i worked with 2 weeks ago!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have an answer but I'm having the exact same issue. I can fetch from a Bitbucket repo from my office network, but when I get home I get the same error as reported.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
Running `ssh -Tv git@bitbucket.org` I can confirm that succeeds from the following
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([2406:da00:ff00::6b17:d1f5]:22).
Super mysterious. I use the same SSH keys on GitHub just fine from home and office so my SSH client is working.
macOS 10.14.5
git version 2.22.0
openssl: stable 1.0.2s (bottled) [keg-only]
ssh -V reports "OpenSSH_7.9p1, LibreSSL 2.7.3"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had an issue similar to frank_hoffsummer's problem.
I found the problem to be that I have multiple identities on bitbucket.org, and different ssh keys associated with each one. The clue was noticing the result of doing `ssh -T git@bitbucket.org`. The response that I got was
plsuh@Paul-MacBook-Air ~ % ssh -T git@bitbucket.org
logged in as paul_suh
You can use git to connect to Bitbucket. Shell access is disabled
plsuh@Paul-MacBook-Air ~ %
Note the username that I highlighted in bold. That was the wrong account on bitbucket.org for the repository I was trying to push to.
The ssh keys are added to ssh-agent in a non-deterministic order for each time that you log in to your local machine (unless you do something special). As a result, sometimes the key for one account was tried first, at other times the key for a different account was tried first. Each login succeeded, but one account didn't have the correct access rights while the other one did.
I solved the immediate problem by removing all but one key from ssh-agent.
In the long run, I will need to set up something like the solutions in this Stack Overflow question:
https://stackoverflow.com/questions/6688655/select-private-key-to-use-with-git
In particular, ignore the "accepted" answer and look at the one below it by Richard Smith.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same problem!
```
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([18.234.32.155]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_ALL = en_US.UTF-8
debug1: Sending env LANG = ru_RU.UTF-8
debug1: Sending env LC_CTYPE = UTF-8
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2772, received 1640 bytes, in 10.1 seconds
Bytes per second: sent 273.6, received 161.9
debug1: Exit status -1
```
When I use VPN - all OK. What the problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Retring ssh -Tv git@bitbucket.org to another IP from list:
$ host bitbucket.org
bitbucket.org has address 18.234.32.157
bitbucket.org has address 18.234.32.156
bitbucket.org has address 18.234.32.155
with another result:
----
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([18.234.32.157]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_ALL = en_US.UTF-8
debug1: Sending env LANG = ru_RU.UTF-8
debug1: Sending env LC_CTYPE = UTF-8
logged in as eagleas
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 2772, received 1832 bytes, in 0.3 seconds
Bytes per second: sent 10890.2, received 7197.3
debug1: Exit status 0
----
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([18.234.32.156]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_ALL = en_US.UTF-8
debug1: Sending env LANG = ru_RU.UTF-8
debug1: Sending env LC_CTYPE = UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
logged in as eagleas
You can use git or hg to connect to Bitbucket. Shell access is disabled
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2772, received 1832 bytes, in 0.3 seconds
Bytes per second: sent 10967.8, received 7248.6
debug1: Exit status 0
----
and again .155:
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([18.234.32.155]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_ALL = en_US.UTF-8
debug1: Sending env LANG = ru_RU.UTF-8
debug1: Sending env LC_CTYPE = UTF-8
packet_write_wait: Connection to 18.234.32.155 port 22: Broken pipe
It seems to me - problem with server on IP: 18.234.32.155. Please, look into this.
This problem exists for a long time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow you're right. I have had the same problem for months
https://community.atlassian.com/t5/Git-questions/Unable-to-access-repo-via-SSH-fatal-Could-not-read-from-remote/qaq-p/1075122
As soon as I connect to VPN, git ls-remote suddenly succeeds
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If VPN's work, does this mean it could be geolocation-based?
Some IP Adresses could be refused based on their location :sad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same problem here
Authenticated to bitbucket.org ([18.205.93.2]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: channel 0: free: client-session, nchannels 1
Connection to bitbucket.org closed by remote host.
Transferred: sent 2520, received 1580 bytes, in 0.0 seconds
Bytes per second: sent 53653025.8, received 33639595.5
debug1: Exit status -1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A lot of mis-configurations can result in this issue. For me for example, I moved my repo from one workspace to another so the git url of the repo changed. I initially forgot to updated the remote url in my local repository, and the same error popped up when I tried to push.
After updating the remote url then everything worked again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the exact same problem, and after reading through this entire thread, none of the solutions offered here did it for me. After lots of trial and error, I found the solution for me
I have the public ssh key that I want to use with BitBucket configured on my bitbucket.org account page https://bitbucket.org/account/settings/ssh-keys/
The version of my ~/.ssh/config file that didn't work for me looked like this
Host *
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
UseKeychain yes
AddKeysToAgent yes
Compression yes
StrictHostKeyChecking no
ForwardAgent yes
ForwardX11 no
ServerAliveInterval 600
Host bitbucket.org
HostName bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa_bitbucket
so I have one key that I want to use as default (~/.ssh/id_rsa configured in "Host *" section) and another that I want to use with BitBucket (~/.ssh/id_rsa_bitbucket configured in "Host bitbucket.org" section)
While this setup is working with any other site I need to use git or ssh with (e.g. github.com), it doesn't with Bitbucket. So removing the first default key (~/.ssh/id_rsa configured in "Host *" section) did the trick. The working ~/.ssh/config file now looks like this
Host *
IdentitiesOnly yes
UseKeychain yes
AddKeysToAgent yes
Compression yes
StrictHostKeyChecking no
ForwardAgent yes
ForwardX11 no
ServerAliveInterval 600
Host bitbucket.org
HostName bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa_bitbucket
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you! Removing the default entry `IdentityFile ~/.ssh/id_rsa` from `Host *` solved this problem for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've multiple routers in my house. When i switched the WIFI to the new one, git wont push and gives me this error, but when connected to the old WIFI, and it works. Weird!
Platform : git bash - windows 10
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is really confusing when I have multiple project in github, bitbucket's different accounts.
I removed the SSH key from repo, but add SSH key into the account bucket setting, then it works fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is still going on. ssh keys are installed in the user profile. i can pull but not push, same mysterious error message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually I was having this problem on a Mac, after trying some solutions I just restarted the computer and BANNG... it worked fine again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ana, thanks for your answer,
The ssh key seems to be correctly added to the ssh agent, but still bitbucket.org is kicking me out without any further explanation...
$ ssh-add -L
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ ... WwksXHHvXIFbIp /home/roberto/.ssh/id_bitbucket
$ cat ~/.ssh/config
Host bitbucket.org
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_bitbucket
$ ssh -Tv git@bitbucket.org
OpenSSH_7.6p1 Ubuntu-4ubuntu0.1, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /home/roberto/.ssh/config
debug1: /home/roberto/.ssh/config line 1: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to bitbucket.org [18.205.93.1] port 22.
debug1: Connection established.
debug1: identity file /home/roberto/.ssh/id_bitbucket type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/roberto/.ssh/id_bitbucket-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.1
debug1: Remote protocol version 2.0, remote software version conker_1.1.17-9953920 app-155
debug1: no match: conker_1.1.17-9953920 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: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> 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 /home/roberto/.ssh/known_hosts:31
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: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:KwjrafCTA0P4mDiNqNztGEmmYkpdcGN633rHnL81AEM /home/roberto/.ssh/id_bitbucket
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([18.205.93.1]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_MEASUREMENT = es_ES.UTF-8
debug1: Sending env LC_PAPER = es_ES.UTF-8
debug1: Sending env LC_MONETARY = es_ES.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_NAME = es_ES.UTF-8
debug1: Sending env LC_ADDRESS = es_ES.UTF-8
debug1: Sending env LC_NUMERIC = es_ES.UTF-8
debug1: Sending env LC_TELEPHONE = es_ES.UTF-8
debug1: Sending env LC_IDENTIFICATION = es_ES.UTF-8
debug1: Sending env LC_TIME = es_ES.UTF-8
debug1: channel 0: free: client-session, nchannels 1
Connection to bitbucket.org closed by remote host.
Transferred: sent 3136, received 1640 bytes, in 20.5 seconds
Bytes per second: sent 153.2, received 80.1
debug1: Exit status -1
$ git pull
Connection to bitbucket.org closed by remote host.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists
Also, the SSH key seems to be already included in my bitbucket.org settings...
This really happened from one day to the next one. All repositories which I had been using since years ago, suddenly became unreachable without me touching the ssh config at all (in my two computers at the same time). Do you have any further idea? Thanks :-)
Regards,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roberto,
Did you use sudo? This is a very common mistake and is explained here.
If that's not your case:
Let us know!
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Ana,
Thank you for your answer. Some post-mortem answers:
Luckily now my repos are back to normal as I posted before.
Kind regards,
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.