You are not logged in.

#1 2023-11-03 18:50:22

ItsSyfe
Member
Registered: 2023-11-03
Posts: 4

[SOLVED] SSH Not Connecting

Hi I've been having an issue I haven't been able to solve, I've got an Ubuntu local server setup with keypair auth (ed25519) which I'm able to connect to via OpenSSH on a separate Windows machine (also on the same network) but my laptop (on Arch) can't connect for some reason.

ssh -v <user>@<host>

OpenSSH_9.5p1, OpenSSL 3.1.4 24 Oct 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 2: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: Connecting to <host> [<host>] port 22.
debug1: Connection established.
debug1: identity file /home/syfe/.ssh/id_rsa type -1
debug1: identity file /home/syfe/.ssh/id_rsa-cert type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/syfe/.ssh/id_ed25519 type 3
debug1: identity file /home/syfe/.ssh/id_ed25519-cert type -1
debug1: identity file /home/syfe/.ssh/id_ed25519_sk type -1
debug1: identity file /home/syfe/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/syfe/.ssh/id_xmss type -1
debug1: identity file /home/syfe/.ssh/id_xmss-cert type -1
debug1: identity file /home/syfe/.ssh/id_dsa type -1
debug1: identity file /home/syfe/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.5

And on the server

cat /var/log/auth.log

Nov  3 18:42:27 <hostname> sshd[3067]: fatal: Timeout before authentication for <laptop ip> port 36570

I'm able to use 'ssh -v git@github.com' fine though which makes it more confusing.

Any help is appreciated!

Last edited by ItsSyfe (2023-11-04 05:23:26)

Offline

#2 2023-11-03 19:37:46

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: [SOLVED] SSH Not Connecting

The ssh -v output appears to have been truncated.  Please post the full output in code tags not quote tags.

Offline

#3 2023-11-03 19:53:59

ItsSyfe
Member
Registered: 2023-11-03
Posts: 4

Re: [SOLVED] SSH Not Connecting

loqs wrote:

The ssh -v output appears to have been truncated.  Please post the full output in code tags not quote tags.

Those logs aren't truncated which is the issue, I'm not getting anything back from the server, here's all the console output again in code tags though.

ssh -v <user>@<host>

OpenSSH_9.5p1, OpenSSL 3.1.4 24 Oct 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 2: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: Connecting to <host> [<host>] port 22.
debug1: Connection established.
debug1: identity file /home/syfe/.ssh/id_rsa type -1
debug1: identity file /home/syfe/.ssh/id_rsa-cert type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/syfe/.ssh/id_ed25519 type 3
debug1: identity file /home/syfe/.ssh/id_ed25519-cert type -1
debug1: identity file /home/syfe/.ssh/id_ed25519_sk type -1
debug1: identity file /home/syfe/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/syfe/.ssh/id_xmss type -1
debug1: identity file /home/syfe/.ssh/id_xmss-cert type -1
debug1: identity file /home/syfe/.ssh/id_dsa type -1
debug1: identity file /home/syfe/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.5

The server never gives a response with it's version.

Offline

#4 2023-11-03 20:00:03

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: [SOLVED] SSH Not Connecting

If you increase the verbosity to the maximum with `ssh -vvv` is any more output produced?  Does the connection attempt time out or stall indefinitely?

Offline

#5 2023-11-03 20:19:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,074

Re: [SOLVED] SSH Not Connecting

Firewall/netfilter on either end or inbetween?
MTU issue? ("ip l")
Can/do you interact w/ the remote host through other protocols (nfs, ftp, telnet, smb, cups, …)?
Can you connect to the host via it's IP?

Btw, if those are LAN IPv4's, you can just post them - they're use- and meaningless outside the LAN, but could be interesting if they're eg. in different segments.

Offline

#6 2023-11-03 23:19:07

ItsSyfe
Member
Registered: 2023-11-03
Posts: 4

Re: [SOLVED] SSH Not Connecting

seth wrote:

Firewall/netfilter on either end or inbetween?
MTU issue? ("ip l")
Can/do you interact w/ the remote host through other protocols (nfs, ftp, telnet, smb, cups, …)?
Can you connect to the host via it's IP?

Btw, if those are LAN IPv4's, you can just post them - they're use- and meaningless outside the LAN, but could be interesting if they're eg. in different segments.

Forgot they're local ips so it doesn't matter, oops.

nmap 10.2.169.4 -p 22

Starting Nmap 7.94 ( https://nmap.org ) at 2023-11-03 23:04 GMT
Nmap scan report for 10.2.169.4
Host is up (0.066s latency).

PORT   STATE SERVICE
22/tcp open  ssh

Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
ping 10.2.169.4

PING 10.2.169.4 (10.2.169.4) 56(84) bytes of data.
64 bytes from 10.2.169.4: icmp_seq=1 ttl=63 time=45.0 ms
64 bytes from 10.2.169.4: icmp_seq=2 ttl=63 time=69.3 ms
64 bytes from 10.2.169.4: icmp_seq=3 ttl=63 time=92.0 ms
64 bytes from 10.2.169.4: icmp_seq=4 ttl=63 time=12.9 ms
64 bytes from 10.2.169.4: icmp_seq=5 ttl=63 time=34.9 ms
^C
--- 10.2.169.4 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 12.899/50.818/92.023/27.444 ms
ip l

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether 30:05:05:d4:8a:e1 brd ff:ff:ff:ff:ff:ff

Here's the output from my Windows (10.2.171.212) install (with -v) that connects correct.

ssh -v syfe@10.2.169.4

OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data C:\\Users\\Syfe/.ssh/config
debug1: Connecting to 10.2.169.4 [10.2.169.4] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\Syfe/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\Syfe/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\Syfe/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\Syfe/.ssh/id_dsa-cert type -1
debug1: identity file C:\\Users\\Syfe/.ssh/id_ecdsa type -1
debug1: identity file C:\\Users\\Syfe/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\Syfe/.ssh/id_ed25519 type 3
debug1: identity file C:\\Users\\Syfe/.ssh/id_ed25519-cert type -1
debug1: identity file C:\\Users\\Syfe/.ssh/id_xmss type -1
debug1: identity file C:\\Users\\Syfe/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.4
debug1: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.2.169.4:22 as 'syfe'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:9PznnTjPP8U8CVX2TsbGRN1ZB8HYm+fEuaF6z9WEu4w
debug1: Host '10.2.169.4' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\Syfe/.ssh/known_hosts:2
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\Syfe/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\Syfe/.ssh/id_dsa
debug1: Will attempt key: C:\\Users\\Syfe/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\Syfe/.ssh/id_ed25519 ED25519 SHA256:eDFHaLWtV7I3RT0D2URp7wWZyhlN39u76nxXmBQGPT4
debug1: Will attempt key: C:\\Users\\Syfe/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: kex_input_ext_info: publickey-hostbound@openssh.com (unrecognised)
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\Syfe/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\Syfe/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\Syfe/.ssh/id_ecdsa
debug1: Offering public key: C:\\Users\\Syfe/.ssh/id_ed25519 ED25519 SHA256:eDFHaLWtV7I3RT0D2URp7wWZyhlN39u76nxXmBQGPT4
debug1: Server accepts key: C:\\Users\\Syfe/.ssh/id_ed25519 ED25519 SHA256:eDFHaLWtV7I3RT0D2URp7wWZyhlN39u76nxXmBQGPT4
debug1: Authentication succeeded (publickey).
Authenticated to 10.2.169.4 ([10.2.169.4]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: ENABLE_VIRTUAL_TERMINAL_INPUT is supported. Reading the VTSequence from console
debug1: ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported. Console supports the ansi parsing
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: /home/syfe/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/syfe/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Last login: Fri Nov  3 18:31:50 2023 from 10.2.171.212
syfe@syfe-hs:~$
loqs wrote:

If you increase the verbosity to the maximum with `ssh -vvv` is any more output produced?  Does the connection attempt time out or stall indefinitely?

And here's from the output of my Arch (10.2.14.104) laptop which doesn't work (and stalls indefinitely).

ssh -vvv syfe@10.2.169.4

OpenSSH_9.5p1, OpenSSL 3.1.4 24 Oct 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 2: include /etc/ssh/ssh_config.d/*.conf matched no files
debug2: resolve_canonicalize: hostname 10.2.169.4 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/syfe/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/syfe/.ssh/known_hosts2'
debug3: ssh_connect_direct: entering
debug1: Connecting to 10.2.169.4 [10.2.169.4] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: Connection established.
debug1: identity file /home/syfe/.ssh/id_rsa type -1
debug1: identity file /home/syfe/.ssh/id_rsa-cert type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/syfe/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/syfe/.ssh/id_ed25519 type 3
debug1: identity file /home/syfe/.ssh/id_ed25519-cert type -1
debug1: identity file /home/syfe/.ssh/id_ed25519_sk type -1
debug1: identity file /home/syfe/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/syfe/.ssh/id_xmss type -1
debug1: identity file /home/syfe/.ssh/id_xmss-cert type -1
debug1: identity file /home/syfe/.ssh/id_dsa type -1
debug1: identity file /home/syfe/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.5

And this is from /var/log/auth.log

Nov  3 23:04:50 syfe-hs sshd[3172]: fatal: Timeout before authentication for 10.2.14.104 port 49266
Nov  3 23:06:04 syfe-hs sshd[3175]: Accepted publickey for syfe from 10.2.171.212 port 41641 ssh2: ED25519 SHA256:eDFHaLWtV7I3RT0D2URp7wWZyhlN39u76nxXmBQGPT4
Nov  3 23:07:13 syfe-hs sshd[3174]: fatal: Timeout before authentication for 10.2.14.104 port 59398

Offline

#7 2023-11-04 05:24:31

ItsSyfe
Member
Registered: 2023-11-03
Posts: 4

Re: [SOLVED] SSH Not Connecting

Ended up being some weird thing with the router setup (should've clarified its a uni setup), spoofing mac address and obtaining a new local ip has somehow fixed it.

Offline

Board footer

Powered by FluxBB