I have a server behind a router, and I have forwarded port 22 (TCP/UDP). I can SSH to the IP (ssh [email protected]) but not to the DNS (ssh [email protected]). I'm getting:
Permission denied (publickey,password).
I have verified that the DNS is indeed leading to the server by turning it off (in which case I get no response trying SSH). I have tried forcing SSH over IPv4 using the DNS, but it doesn't seem to be the issue. I have tried "UseDNS no" and "GSSAPIAuthentication no" to no avail.
var/log/secure
is empty. Looking at var/log/auth.log
I can see from the same minute I tried to connect that:
Mar 8 21:47:00 myhost sshd[1033]: Received disconnect from xx.xxx.xxx.xxx: 11: disconnected by user
Mar 8 21:47:00 myhost sshd[1031]: pam_unix(sshd:session): session closed for user myuser
Mar 8 21:47:08 myhost sshd[1052]: Connection closed by xx.xxx.xxx.xxx [preauth]
/var/log/auth.log
or/var/log/secure
for possible errors?.ssh/config
that's doing something specific to the hostname.