LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 07-25-2011, 03:40 AM   #1
alanv
LQ Newbie
 
Registered: Jun 2010
Distribution: Ubuntu, Debian, Fedora
Posts: 21

Rep: Reputation: 0
Question 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.
 
Old 07-25-2011, 04:10 AM   #2
Lexus45
Member
 
Registered: Jan 2010
Location: Kurgan, Russia
Distribution: Slackware, Ubuntu
Posts: 339
Blog Entries: 3

Rep: Reputation: 47
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.

Last edited by Lexus45; 07-25-2011 at 04:13 AM.
 
Old 07-25-2011, 10:05 AM   #3
alanv
LQ Newbie
 
Registered: Jun 2010
Distribution: Ubuntu, Debian, Fedora
Posts: 21

Original Poster
Rep: Reputation: 0
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.

Thank you

Last edited by alanv; 07-25-2011 at 10:12 AM.
 
Old 07-25-2011, 10:11 AM   #4
alanv
LQ Newbie
 
Registered: Jun 2010
Distribution: Ubuntu, Debian, Fedora
Posts: 21

Original Poster
Rep: Reputation: 0
Here is the routing table in A:

[alan@fedora ~]$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

Last edited by alanv; 07-25-2011 at 10:14 AM.
 
Old 07-25-2011, 01:09 PM   #5
alanv
LQ Newbie
 
Registered: Jun 2010
Distribution: Ubuntu, Debian, Fedora
Posts: 21

Original Poster
Rep: Reputation: 0
Here is more information:

The exact same problem is present when I use a laptop behind the same router as computer A.
 
Old 07-25-2011, 03:25 PM   #6
sandwormusmc
Member
 
Registered: Nov 2006
Distribution: Fedora 15 x86_64
Posts: 75

Rep: Reputation: 24
Quote:
Originally Posted by alanv View Post
"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.
 
  


Reply

Tags
port, ssh, ssh access, ssh remote


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
LXer: ssh-xfer: Quickly grabbing files over an existing SSH connection LXer Syndicated Linux News 0 08-08-2008 03:11 PM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 03:15 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM


All times are GMT -5. The time now is 07:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration