When I try to ssh into one of my rpis (let's call it .7) with verbose I get the following output
ssh [email protected] -v
OpenSSH_8.9p1 Ubuntu-3ubuntu0.4, OpenSSL 3.0.2 15 Mar 2022
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 *
debug1: Connecting to 192.168.1.7 [192.168.1.7] port 22.
and it just hangs endlessly.
I'm able to connect to all other raspberry pis in my house except for this particular one (no idea why). I've even tried to log into another rpi (say .62) and then I was able to ssh from it into (.7), which leads me to suspect that it's a problem with the config of my laptop, although I cannot figure out what it is.
Update 1
ssh_config file
Include /etc/ssh/ssh_config.d/*.conf
Host *
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
sshd_config file
Include /etc/ssh/sshd_config.d/*.conf
KbdInteractiveAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
and the second file does not exist
Update 2
OpenSSH_8.9p1 Ubuntu-3ubuntu0.4, OpenSSL 3.0.2 15 Mar 2022
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 *
debug2: resolve_canonicalize: hostname 192.168.1.7 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/username/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/username/.ssh/known_hosts2'
debug3: ssh_connect_direct: entering
debug1: Connecting to 192.168.1.7 [192.168.1.7] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
Update 3
The output of tcpdump is as follows
sudo tcpdump -i wlp0s20f3 -n 'port 22'
[sudo] password for myusername:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on wlp0s20f3, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:11:10.086559 IP 192.168.1.5.50418 > 192.168.1.7.22: Flags [S], seq 441937362, win 64240, options [mss 1460,sackOK,TS val 2181705493 ecr 0,nop,wscale 7], length 0
10:11:11.087399 IP 192.168.1.5.50418 > 192.168.1.7.22: Flags [S], seq 441937362, win 64240, options [mss 1460,sackOK,TS val 2181706494 ecr 0,nop,wscale 7], length 0
10:11:13.103394 IP 192.168.1.5.50418 > 192.168.1.7.22: Flags [S], seq 441937362, win 64240, options [mss 1460,sackOK,TS val 2181708510 ecr 0,nop,wscale 7], length 0
10:11:17.199574 IP 192.168.1.5.50418 > 192.168.1.7.22: Flags [S], seq 441937362, win 64240, options [mss 1460,sackOK,TS val 2181712606 ecr 0,nop,wscale 7], length 0
where my laptop is 192.168.1.5 and my wireless card interface (obtained from ifconfig) is wlp0s20f3. I basically run the command and then in a separate terminal window tried to ssh into the (.7)
/etc/ssh/ssh_config
and~/.ssh/config
from your client system (Ubuntu?) in the question. (The second file might not exist - that's ok, but tell us.) Also, if the files are too large you can omit all blank lines and lines starting with#
)sshd_config
file but I need to see thessh_config
file. Please check-vv
or-vvv
- when I was trying to troubleshoot connection that hung due to firewall port forwarding rules it was very helpful to see the connection being established. Another thing I did was monitoring the exchange withtcpdump
. In that case there was only SYN connection but no SYN-ACK response. Asking tcpdump to filter out everything else helps a lot.