Score:1

kex_exchange_identification: read: Connection timed out when trying to ssh to a laptop on LAN

jp flag

So I've got a laptop running Pop! OS (20.04 LTS), I've just installed openssh-server via sudo apt-get install openssh-server and I'm attempting to SSH into it from my Windows 10 desktop PC but I get the following error:

PS C:\Users\enricojr\.ssh> ssh -vvv 192.168.254.203
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data C:\\Users\\enricojr/.ssh/config
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname 192.168.254.203 is address
debug2: ssh_connect_direct
debug1: Connecting to 192.168.254.203 [192.168.254.203] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\enricojr/.ssh/id_rsa type 0
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_rsa-cert error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_rsa-cert.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_rsa-cert type -1
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_dsa error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_dsa.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_dsa type -1
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_dsa-cert error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_dsa-cert.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_dsa-cert type -1
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_ecdsa error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_ecdsa.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_ecdsa type -1
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_ecdsa-cert error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_ecdsa-cert.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_ecdsa-cert type -1
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_ed25519 error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_ed25519.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_ed25519 type -1
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_ed25519-cert error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_ed25519-cert.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_ed25519-cert type -1
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_xmss error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_xmss.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_xmss type -1
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_xmss-cert error:2
debug3: Failed to open file:C:/Users/enricojr/.ssh/id_xmss-cert.pub error:2
debug1: identity file C:\\Users\\enricojr/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug3: recv - from CB(2) ERROR:138, io:000001B6A4A39080
kex_exchange_identification: read: Connection timed out

Ping is fine, tracert is fine too (unless otherwise specified all commands are being run from Windows Powershell)

PS C:\Users\enricojr\.ssh> tracert 192.168.254.203

Tracing route to 192.168.254.203 over a maximum of 30 hops

  1     2 ms     1 ms     2 ms  192.168.254.203

Trace complete.

PS C:\Users\enricojr\.ssh> ping 192.168.254.203

Pinging 192.168.254.203 with 32 bytes of data:
Reply from 192.168.254.203: bytes=32 time=2ms TTL=64
Reply from 192.168.254.203: bytes=32 time=2ms TTL=64
Reply from 192.168.254.203: bytes=32 time=2ms TTL=64
Reply from 192.168.254.203: bytes=32 time=2ms TTL=64

Ping statistics for 192.168.254.203:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 2ms, Maximum = 2ms, Average = 2ms

Running ssh localhost directly on remote (I have the laptop in front of me) prompts me for password and then "connects" just fine.

I was able to scp the public key I wanted to use from my desktop to remote just fine as well.

Additionally, I am able to SSH from desktop to a completely different remote, my Macbook Pro.

I'm almost certain the issue is with the openssh-server installation on pop os but it's pretty much stock, I haven't run any additional commands beyond sudo systemctl stop/restart/status since installing it, and I was under the impression that this would work out of the box.

Any ideas what could be wrong?

edit1: results of ssh-keyscan on desktop -> remote

PS C:\Users\enricojr\.ssh> ssh-keyscan 192.168.254.203
read (192.168.254.203): Connection timed out
read (192.168.254.203): Connection timed out
read (192.168.254.203): Connection timed out
ng flag
What does `ssh-keyscan 192.168.254.203` yield? You can edit your question and post the extra information.
jp flag
@Halfgaar all done, post has been updated. Basically "connection timed out"
ng flag
Does the SSH server log say something useful? Typically, that's `/var/log/auth.log`, but I don't know Pop! OS.
Score:0
jp flag

I don't know if this is just a coincidence or not -

When I first set this machine up I set up a static IP address outside my router's DHCP range, but neglected to set the netmask properly.

Changing it from 0.0.0.0 -> 255.255.255.0 and restarting seems to have fixed the problem, but I don't see what the netmask has to do with any of this so it could all just be coincidence.

ng flag
The netmask determines whether local net or your gateway gets the replies. It makes sense that you'd get weird connection errors then.
jp flag
That does it then. I was watching tcpdump output and seeing responses go out normally while I was debugging this so yeah it makes sense now.
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.