I can ssh from A to B and from B to C, but not from A to C
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I can ssh from A to B and from B to C, but not from A to C
Hello,
Until yesterday I was able to ssh to servers B,C,D,E from my home computer (A).
But since today, I keep getting the message:
ssh: connect to host C port 22: Network is unreachable
This ONLY happens when I try to ssh from A to C,D,E. If I try to ssh from A to B it works as usual.
Also, if I ssh from A to B and then, from B to C,D,E, everything works as usual. A is behind a router, by the way.
The servers to which I cannot ssh directly (C,D,E) are all part of the same network (servers in the same institution). Server B is in another institution.
Do you have any suggestion to solve this problem? Please be detailed in you explanations or questions; I am new to ssh and networks, so I am not familiar with the terminology.
Thank you very much
In case it matters: A is running Fedora 14, B is running OpenSUSE 11.2, C is running Ubuntu 11.04, D is running Fedora 13, E is running Fedora 8. I have admin access to A and C.
Hello.
I'm sure, the reason is not in SSH, it's in routing. :-)
You may try to add an entry to your routing table (at host A), to specify exactly the destination network (C, D, E hosts) and the gateway for it (B-router).
Another reason is that somebody changed the firewall rules on the B-router.
If you don't keep it in a secret, you may also show us your routing table and tell the network address of C, D and E hosts.
I'm not sure if I understand correctly. B is not a router, it's just another server like C,D,E. The router causes no trouble when I try to connect to B. Also, until yesterday the router didn't cause trouble when I tried to connect to C,D,E either. I want to be able to connect from A to C,D,E directly again (without using B).
I am very confused by this. After leaving my home computer (A) for some hours, I can now connect from A to C,E. But it takes about 20 seconds to ask for my password! But after putting my password, everything seems to work fine. On the other hand, if I ssh from A to B and then from B to C,E, it takes less than a second to ask for my password. If I try to ssh from A to D, it now says
"ssh: Could not resolve hostname D: Name or service not known", but I can ssh from A to B and from B to D.
By the way, B is 13000 miles away from A. C,D,E are just 5 miles away from A.
I am not familiar with the terms "routing table", "gateway". I will google how to find those and will post them.
"ssh: Could not resolve hostname D: Name or service not known", but I can ssh from A to B and from B to D.
"Could not resolve" errors are generally due to DNS issues ... are you SSH'ing by FQDN* or by IP address? Dumping the IP/hostname pair into your /etc/hosts file may speed up the connection. Also, you can install nscd which will cache host names with a "yum install nscd -y; service nscd start; chkconfig nscd on".
Also, check to make sure your DHCP server (or router) is handing out the correct DNS entries, or put the entries in your /etc/resolv.conf file manually to expedite DNS lookups. For example you should have a line in /etc/resolv.conf that reads something like this:
nameserver <IP.given.by.your.ISP>
The DNS IP is usually given automatically by DHCP, but may not be in case your DHCP server isn't 100% setup correctly.
HTH
FQDN = fully qualified domain name (i.e. hostname.somedomain.com)
Last edited by sandwormusmc; 07-25-2011 at 03:29 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.