-1

I have a really annoying problem with my server, even I couldn't find any search term to google it.

Let me explain it.

on my server I can connect to ssh using with ip address it is ok.

ex : ssh -p2222 ubuntu@xx.xxx.xxx.xx It is working.

but I cannot login with domain name. SSH connects, it asks for password for user ubuntu but the password doesn't work.

ex : ssh -p2222 ubuntu@domainname.com It is not working.

FZE
  • 1,587
  • 12
  • 35
  • what IP does a DNS lookup for `domainname.com` return? Is it the same? – reto Apr 17 '14 at 09:04
  • Your IP is registered to DNS server ?? – Rahul R Dhobi Apr 17 '14 at 09:09
  • what does `nslookup domainname` returns? does it show hte correct IP ? – slayedbylucifer Apr 17 '14 at 09:29
  • @reto yes, it is, I checked through online dnslookup tool and also pinged from my computer to be sure is the same ip. – FZE Apr 17 '14 at 12:39
  • @RahulRDhobi yes it is also in same computer, I use bind. – FZE Apr 17 '14 at 12:40
  • @slayedbylucifer it returns correct IP. It is so wierd, I cannot connect and don't know what is the problem. – FZE Apr 17 '14 at 12:40
  • oh I see one interesting result when I type my password when connecting ssh, It returns "Permission denied, please try again." – FZE Apr 17 '14 at 12:48
  • 1
    provide the output of `ssh -p2222 ubuntu@domainname.com -vvv` – slayedbylucifer Apr 17 '14 at 13:28
  • @slayedbylucifer I just shocked, I see line debug1: Connecting to yourdomain.com [::1] port 2222. It is so weird, there is no record on hosts file, I can connect my domain through scp, webbrowser and other things, but ssh it such a wierd. – FZE Apr 18 '14 at 12:36

1 Answers1

0

Be sure you use same EC2 Key Pair when you start your instance.

togikan
  • 331
  • 6
  • 15
  • I'm sure for that, I was using it without problems but I changed ssh port from 22 to 2222 and the problem occured after that. I opened port on ec2 dashboard security section, also changed from sshd_config. I restarted networking and sshd several times, rebooted machine, but doesn't worked. – FZE Apr 18 '14 at 12:32
  • If it is possible for you to connect on port 2222, your authentication problem shouldn't be related with changing ports 22 to 2222. – togikan Apr 21 '14 at 13:53