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

I am new to Linux and SSH. when I try to connect to a remote grid computer (for which I have access) I am getting connection timed out error. I have recently installed Ubuntu in my system. I also have OpenSSH client and server. Port 22 is enabled and I can access localhost.

Kindly give me a step by step procedure to solve the problem, as I am new to this whole thing.


share|improve this question
Post the output of ssh -vvv host:port – ignite Mar 4 '13 at 9:40
output is Open SSH_6.0p1 Debian-3ubuntu1, OpenSSL 1.01c 10May 2012 debug1: reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line19: Applying option for * debug2: ssh_connect: needpriv 0 ssh: could not resolve hostname (my host name:port no): name or service not known – Priya Mar 4 '13 at 10:03
Is the address valid, are you able to ping to that address? – ignite Mar 4 '13 at 10:17
The address is valid. my boss is able to connect from his system. – Priya Mar 4 '13 at 10:19
Clearly the hostname does not resolve into an ip. Can you post the output of 'host yourhostname' (f.e. host or use ip instead of yourhostname when you ssh into the server? – arrange Mar 4 '13 at 11:15

Try to check if port 22 is listening:

sudo netstat -alnp|grep :22

Try to allow port in ufw

sudo ufw allow 22

sudo ufw disable && sudo ufw enable

Try to add port into iptables

sudo iptables -A INPUT -i eth1 -p tcp --dport 22 -j ACCEPT

Is port forwarded?

share|improve this answer
how do i know whether the port is forwarded ? – Priya Mar 4 '13 at 10:25
These instructions are to check if the server is working and to open firewall on the server but the problem is the client not reaching the server (name resolution problem as seen in comments on Question) and other people are able to connect so I don't think it would be wise to change things on the server at 1st attempt. – laurent Mar 4 '13 at 11:43

After checking all of your iptables and etc.

Maybe your network Administrator block the port 22 on the LAN switches or change the default ssh port to other number, So check it by him.

share|improve this answer

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.