1

This is my first post on stackexchange and I am a Linux newbie, so if I misconduct anyhow, let me know.

Every time I try to ssh (or telnet) into anything that isn't localhost I cannot connect due to connection time out. Example of output after running ssh -vvv git@github.com:

ssh -vvv git@github.com
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/klnsptr/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/klnsptr/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/klnsptr/.ssh/known_hosts2'
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [140.82.121.3] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: connect to address 140.82.121.3 port 22: Connection timed out
ssh: connect to host github.com port 22: Connection timed out

Another thing is that I can clone github repositories if I do it over https. However, trying to use an ssh address leaves me at a "Cloning into 'x'..." prompt and later timing out.

I don't think the issue is with my ISP since ssh works perfectly fine on my Windows 10 (using PuTTY), and on a Macbook connected to the same network.

Also, my firewall is turned off so I that's not the issue either.

Tried: reinstalling ssh, rebooting the system, restarting the router, deleting ssh_config. No google search resolved the problem.

My setup is: Ubuntu 22.04 on one SSD (C:) and Win 10 on other SSD(D:). Using grub to boot into one or the other. The pc is connected to a stock router I got from the ISP via an Ethernet cable.

How do I fix this?

Thanks

EDIT: -no vpn -firewall off (ufw status: inactive)

EDIT 2: reinstalled ubuntu, the issue persists.

EDIT 3: So I created a VM from the same iso that I installed ubuntu with just to check what happens. Turns out ssh works in the VM. (?????)

EDIT 4: Reinstalled ubuntu again, updated to 22.10 - nothing. Then, I downgraded to 20.04 - the issue is resolved, ssh works just fine now. However, I am still looking for a solution for 22.04 if anyone has any ideas.

  • 2
    Your account name on github.com is git? – user unknown Nov 10 '22 at 17:44
  • can you use ssh -v (or -vvv) to see what is happening? – Esther Nov 10 '22 at 18:11
  • 1
    @user unkown no, thats the command the wiki tells you to exectute for checking if ssh works. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection – klnstprx Nov 10 '22 at 18:49
  • @Esther, edited the question. – klnstprx Nov 10 '22 at 18:54
  • are you sure the firewall is off? – Esther Nov 10 '22 at 20:00
  • sudo ufw status returns: Status: inactive I didn't install any firewall, I am on a fresh ubuntu. – klnstprx Nov 10 '22 at 20:04
  • Most likely a network issue. My debug output has Connection established. immediately after the Connecting to github.com line. Before attempting to authenticate. Does SSH work generally, to other hosts, from that machine? It really looks like network, so keep pushing on that front. – John Mee Nov 13 '22 at 01:26
  • @JohnMee i cannot connect to any host while on ubuntu. However, I have windows 10 installed on the same machine on which ssh works just fine. – klnstprx Nov 13 '22 at 12:36
  • "cannot connect to any host"? Does it talk to the Internet at all? You dont say, but it sounds like you are dual booting with windows, and windows is fine. Which is good news because it means your hardware is fine, it is the network connection of the ubuntu install which is at issue. – John Mee Nov 13 '22 at 23:54
  • @JohnMee Yes, sorry, Im dual booting with windows. Im not sure what you mean by "talking to the internet". The browser works fine, also, I don't know if that changes anything, but I can for example: clone a github repository with the https link. – klnstprx Nov 14 '22 at 17:30
  • I got the very same problem recently: the internet box was filtering out the connections for my computer. – Pierre Nov 26 '22 at 14:24
  • So I already had the idea to poke around my router settings, but nothing I did changed my situation. How did you find that out? @Pierre – klnstprx Nov 27 '22 at 20:39

0 Answers0