Score:1

SSH and Telnet timing out. Ubuntu 22.04 lts

ye flag

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.

za flag
Your account name on github.com is git?
Esther avatar
es flag
can you use `ssh -v` (or `-vvv`) to see what is happening?
klnstprx avatar
ye flag
@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 avatar
ye flag
@Esther, edited the question.
Esther avatar
es flag
are you *sure* the firewall is off?
klnstprx avatar
ye flag
`sudo ufw status` returns: `Status: inactive` I didn't install any firewall, I am on a fresh ubuntu.
John Mee avatar
th flag
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.
klnstprx avatar
ye flag
@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.
John Mee avatar
th flag
"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.
klnstprx avatar
ye flag
@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.
Pierre avatar
cn flag
I got the very same problem recently: the internet box was filtering out the connections for my computer.
klnstprx avatar
ye flag
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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.