0

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]
6
  • Can you check /var/log/auth.log or /var/log/secure for possible errors?
    – K. Pande
    Mar 8, 2016 at 20:43
  • 1
    My guess is there's something in .ssh/config that's doing something specific to the hostname.
    – Barmar
    Mar 8, 2016 at 20:52
  • Also check /etc/hosts.deny and /etc/hosts.allow restrictions
    – ALex_hha
    Mar 8, 2016 at 20:57
  • Oh, I'm so stupid... it was ~/.ssh/config that messed it up on my local machine... thanks @Barmar
    – Jay
    Mar 8, 2016 at 21:00
  • 2
    Please post answers as answers. They will not be seen in the question, and the question remains marked as unresolved until an answer is posted. Mar 12, 2016 at 21:40

1 Answer 1

0

Need to change settings in

sshd_config

Change

UseDNS  yes

Kindly check the link below. I have added a screen shot for the same.

http://prntscr.com/aff5e7

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .