I'm trying to debug a problem I have when trying to connect to an SSH host over WAN. I'm looking for a way to confirm that my client is reaching the correct host, and is not routed somewhere else along the way. I have access to both the client and he host. Maybe there a way to monitor every SSH connection request on the host's side to confirm that my request is actually reaching it?The host is a Raspberry Pi running Raspbian, SSH version is OpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013.
How can I confirm the identity of the remote SSH host I'm trying to connect to?
ssh;raspbian
Two things you can do:Read the log files on the server. Which logfile will depend on how your system is configured; start by looking for /var/log/secure and /var/log/messages. If you can't find sshd logs there, check your syslog config for where authpriv messages go.Check the SSH public key returned by the server. Do this by running the commandssh-keyscan hostname > hostname-lan.pub on the lan , andssh-keyscan hostname > hostname-wan.pub on WAN. Then compare the two files (diff hostname-lan.pub hostname-wan.pub). If you're reaching the same server, there should be no difference. (Unless you're using different hostnames; in that case, the hostname will differ but the rest of the key will be the same.)