Initial Post here (closed as not relevant to ServerFault)
I have a raspberry pi with only Key based authentication enabled. When I try to ssh to it using the local IP, it works. But when I try to connect it using a noip domain (dynamic dns), I get Connection reset by <IP>: [preauth] instantly.
Things to know:
- I've changed the default port from 22 to another in
/etc/ssh/sshd_configand yes the new port has been forwarded. - I've restarted the pi and the sshd service.
- I've tried changing up the private/public key pair.
- I've tried tailing the
/var/log/auth.logfile when I try to connect via ddns and all it gives me is theConnection reset [preauth]error - I have a static IP
What works: If I disconnect from my ISP and ssh via my phone hotspot, it works.
What I think: It's the static IP issue? I don't have much knowledge on the matter but as a lay-person I can understand that there might be an issue with the RSA fingerprint or something?
Any help would be appreciated! Thanks.
Logs (sensitive info redacted):
=> ssh -vi ~/.ssh/key <USER>@<DDNS> -p <PORT> OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /Users/kunalnagar/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to <DDNS> port <PORT>. debug1: Connection established. debug1: identity file key type 0 debug1: identity file key-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.1 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Raspbian-10+deb10u2 debug1: match: OpenSSH_7.9p1 Raspbian-10+deb10u2 pat OpenSSH* compat 0x04000000 debug1: Authenticating to <DDNS:PORT> as '<USER>' debug1: SSH2_MSG_KEXINIT sent Connection reset by <STATIC_IP> port xxxx 3 Reset to default