Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

access to repository via ssh fails but https work

andrzejdoro July 21, 2021

Recently, I am not able to access repository via SSH-key (it was working one month ago). When I run push/pull, I receive (after around one minute):

 

Connection to bitbucket.org closed by remote host.
fatal: Could not read from remote repository.

When I change it to HTTPS (git remote set-url origin ...) then it works.

I was thinking that it might be a temporary issue, but I had this problem in previous week in one repository, and now, SSH fails in another repository, so I thing something is wrong.

Best regards,
Andrzej

 

1 answer

1 accepted

1 vote
Answer accepted
Jack July 21, 2021

I remember that Bitbucket had SSH issues a month or so but was resolved after a while. However, this might be also a network issue on your end. Are you on a corporate network or home network? I'm asking because I experienced this problem before and what I did was to use VPN. Not ideal but it worked.

 

Also, have you tried restarting your machine?

andrzejdoro July 22, 2021

I'm using home network, but with my company's VPN turned on it also doesn't work.
Restarting doesn't help.

When I run ssh -v git@bitbucket.org then I receive

OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017 
(...)
debug1: Connecting to bitbucket.org [104.192.141.1] port 22.
debug1: Connection established.
(...)
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/andrzej/.ssh/known_hosts:62
(...)
debug1: Next authentication method: publickey
debug1: Offering public key: RSA (...)
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([104.192.141.1]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
(...)
debug1: Sending env LC_TIME = pl_PL.UTF-8

(now it stops for a few seconds)
and then it fail with the following message

debug1: channel 0: free: client-session, nchannels 1 
Connection to bitbucket.org closed by remote host.
Connection to bitbucket.org closed.
Transferred: sent 4236, received 1848 bytes, in 20.1 seconds
Bytes per second: sent 210.5, received 91.8
debug1: Exit status -1
andrzejdoro July 30, 2021

The problem is indeed in my network. I encounter the same problem when logging via ssh to some other remote machine. When I connect to another network (e.g. through mobile connection) it works.

Like Jack likes this
Jack July 30, 2021

Awesome. Well, not awesome that this problem exists but at least we have a successful workaround. 

andrzejdoro August 2, 2021

Fortunately, in our cases the other network works fine. But what if you have no other choice? I'm going to investigate what might be wrong on the network side.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events