Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

when I am trying to access the server through ssh it says:

ssh: connect to host xx.yyy.zzz.x port 22: Connection refused

and on the server in auth.log it shows following log entry:

Address xx.yyy.zzz.x maps to, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

I have created a user account for that user and it is also in enabled status.

Requested info

  1. It is Ubuntu 11.10
  2. It is configured as SSH Server using openssh-server
  3. I am trying to connect to this server using Putty from Windows 7 i.e. My Desktop
  4. I have also asked this in superuser as per the request of @zpletan and link to that question is given below.

Thanks in advance.

share|improve this question
Maybe it's a dumb question, but do you have the openssh-server package installed on your server? Is your server running Ubuntu? (If not, the proper place to ask this is probably Is it a web server or an internal server? Have you tried deleting ~/.ssh on the computer you're connecting from? – zpletan Apr 3 '12 at 15:14
@zpletan Please check the updated quesion details. Thanks for your interest and have given you 1 up for the comment. – Rishee Apr 3 '12 at 15:29
tray open your port 22 in your ufw -> sudo ufw allow 22 or sudo ufw allow ssh info -> and try to connect again... – hhlp Apr 3 '12 at 15:38
@hhlp Thanks a lot buddy but still it is not working?? :( – Rishee Apr 3 '12 at 15:49
@Rishee, cross-posting is a tricky thing, apparently. How about taking a look at… and acting accordingly. If you decide to close one version of your question, I would probably close this one, as your problem seems to extend beyond Ubuntu. – zpletan Apr 3 '12 at 16:34
up vote 5 down vote accepted

The server may enables UseDNS.

man sshd_config to find information about this.

If you have the right permission, you can modify /etc/ssh/sshd_config and add UseDNS no to this file.

share|improve this answer
Why was this downvoted? This is a good answer. – psusi Apr 3 '12 at 17:49

It looks like your ISP has screwed up their DNS records. ssh appears to be complaining because when it looks up the IP address xx.yyy.zzz.x, it gets the name, but that name does not map back to the IP address, which often is an indicator that someone is trying to spoof their hostname. You should complain to your ISP to fix it, or change the setting fossilet mentioned. Such screwed up DNS records will also prevent you from connecting to most IRC servers.

share|improve this answer
This should only be a problem if your routing the request through the outside world though right? If your on an LAN and connecting to using the LAN IP of the server, why would sshd check the reverse DNS entry? – Ashimema Apr 4 '12 at 7:43
@Ashimema, because it doesn't differentiate between the two; IP is IP, whether it is 3 feet away or the other side of the world. If this is supposed to be a local connection though, you have something messed up somewhere because it shouldn't see the connection coming from your public IP address. – psusi Apr 4 '12 at 13:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.