SSH stopped working (ubuntu 18.04)

mk_street May 10, 2020

I used to have SSH working for all my repositories on my desktop PC.

Something seems to have updated in Ubuntu a few months ago and now SSH no longer works. I didn't report it here right away, but now it has become increasingly annoying.

On my laptop, I can still use SSH to access all my repositories the same as always.

But on my desktop PC, SSH has stopped working.

For example, when I try to do a git push, it hangs for several minutes then eventually comes back with this error:

Pushing to git@bitbucket.org:XXXX/XXXXX.git
ssh: connect to host bitbucket.org port 22: Network is unreachable
fatal: Could not read from remote repository.

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

 

When the problem first occurred, I tried the SSH troubleshooting FAQ, restarting SSH  on the PC, and so forth.

 

I am not an SSH expert.  I just don't know what to try to diagnose the situation or get more information to lead to a solution.

 

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2020

"Network is unreachable" simply means that your client machine cannot get to the target over your network.

This is almost always caused by a local network problem - your machine is simply not on the internet.

Try

ssh -vvv <target>

This gives you a suprising (and yet boring) information about the connection!

mk_street May 12, 2020

I don't think that's the problem.

As I mentioned, I am always able to access bitbucket using https.

It's only SSH that does not work.

As requested, I ran that command:

*****

ssh -vvv bitbucket.org
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "bitbucket.org" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to bitbucket.org [18.205.93.0] port 22.
debug1: connect to address 18.205.93.0 port 22: Connection timed out
debug1: Connecting to bitbucket.org [18.205.93.1] port 22.
debug1: connect to address 18.205.93.1 port 22: Connection timed out
debug1: Connecting to bitbucket.org [18.205.93.2] port 22.
debug1: connect to address 18.205.93.2 port 22: Connection timed out
debug1: Connecting to bitbucket.org [2406:da00:ff00::22e9:9f55] port 22.
debug1: connect to address 2406:da00:ff00::22e9:9f55 port 22: Network is unreachable
debug1: Connecting to bitbucket.org [2406:da00:ff00::6b17:d1f5] port 22.
debug1: connect to address 2406:da00:ff00::6b17:d1f5 port 22: Network is unreachable
debug1: Connecting to bitbucket.org [2406:da00:ff00::22c2:513] port 22.
debug1: connect to address 2406:da00:ff00::22c2:513 port 22: Network is unreachable
debug1: Connecting to bitbucket.org [2406:da00:ff00::22cd:e0db] port 22.
debug1: connect to address 2406:da00:ff00::22cd:e0db port 22: Network is unreachable
debug1: Connecting to bitbucket.org [2406:da00:ff00::22c3:9b0a] port 22.
debug1: connect to address 2406:da00:ff00::22c3:9b0a port 22: Network is unreachable
debug1: Connecting to bitbucket.org [2406:da00:ff00::3403:4be7] port 22.
debug1: connect to address 2406:da00:ff00::3403:4be7 port 22: Network is unreachable
debug1: Connecting to bitbucket.org [2406:da00:ff00::34cc:ea4a] port 22.
debug1: connect to address 2406:da00:ff00::34cc:ea4a port 22: Network is unreachable
debug1: Connecting to bitbucket.org [2406:da00:ff00::22c0:3470] port 22.
debug1: connect to address 2406:da00:ff00::22c0:3470 port 22: Network is unreachable
ssh: connect to host bitbucket.org port 22: Network is unreachable

 

ping google.com
PING google.com (172.217.24.174) 56(84) bytes of data.
64 bytes from kul08s01-in-f14.1e100.net (172.217.24.174): icmp_seq=1 ttl=53 time=20.9 ms
64 bytes from kul08s01-in-f14.1e100.net (172.217.24.174): icmp_seq=2 ttl=53 time=20.9 ms
64 bytes from kul08s01-in-f14.1e100.net (172.217.24.174): icmp_seq=3 ttl=53 time=20.9 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 20.900/20.926/20.976/0.123 ms

*******************

The connecting -> timeout cycles each took about a minute.

At the end, I ping'ed google.com just to show that I am on the network.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events