[SOLVED] ssh port 22: Connection timed out (ubuntu 10.04)
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I replaced my old desktop with a Dell XPS 8300, on which I installed ubuntu 10.04 (obliterating the Windows partition). I can ssh out from the host to other computers, but I can't ssh or telnet in to the host from outside, always getting the message 'ssh: connect to host ... port 22: Connection timed out'. The host is behind a router on which I'm sure I have port 22 forwarded. I do have 'sshd' running on the host.
This is from the host:
$ ping xx.xx.xx.xxx # works
$ ssh localhost # works
$ ssh -vvv xx.xx.xx.xxx
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /home/paul/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to xx.xx.xx.xxx [xx.xx.xx.xxx] port 22.
debug1: connect to address xx.xx.xx.xxx port 22: Connection timed out
ssh: connect to host xx.xx.xx.xxx port 22: Connection timed out
$ telnet xx.xx.xx.xxx 22
Trying xx.xx.xx.xxx ...
telnet: Unable to connect to remote host: Connection timed out
....
I can ssh out from the host to other computers, but I can't ssh or telnet in to the host from outside, always getting the message 'ssh: connect to host ... port 22: Connection timed out'. The host is behind a router on which I'm sure I have port 22 forwarded. I do have 'sshd' running on the host.
....
Hi,
for the 1st step I would try to stop firewall (# service iptables stop) to see if there might be a problem with firewall
then 2nd step I would try to change the SSH port connection to the host with
# ssh -vv -p 2121 x.x.x.x
of course it means that you need to change the port in sshd_config too to accept connections on different port
If that is the case it works, then your ISP might be blocking port 22 (and probably 21, 80 etc.)
Aaarrggh! I found the problem, after many hours. Prompted by lithos' comment, I took a close look at the port forwarding page on my router. The IP address there appeared as 192.168.1.101, and you have the option of replacing the last 3 digits. I had tried 100, 101 and 102. It occurred to me to check 'ifconfig' on the host, where I saw inet addr:192.168.1.103 . I typed in '103' on the router page, and was then able to connect via ssh. I hope some poor soul can benefit from this in the future.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.