Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Connecting to a machine connected directly to a server on another network

Posted on 2006-06-09
7
Medium Priority
?
493 Views
Last Modified: 2010-05-19
Dear experts
I've got a linux server (A) with two network cards:
eth0: 192.168.101.19 & eth1: 192.168.21.19

There is another linux machine (B) connected directly to eth1 with IP 192.168.21.13

I'm using my Windows laptop (C) on another network with IP 192.168.31.10 from which i can reach A, in between C and A there is a gateway that connects both networks (101.X & 31.X)

B:192.168.21.13 ---- 192.168.21.19 (eth1) |Linux Srv A|192.168.101.19 (eth0) ---|Gateway|--- C:192.168.31.10

I would like to connect to the machine B directly from C , is  this possible?
What do i need to configure? (i really would prefer not to touch the gateway, as it's the company one, nor the machine B if at all possible)

Thanks for your help
0
Comment
Question by:ealdaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 2

Accepted Solution

by:
enyamada earned 2000 total points
ID: 16872097

Yes, using ssh forwarding it´s possible to do what you want.

1) From C, download plink (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)

2) From C, use "plink -2 -T -L 999:192.168.21.13:22 -l john 192.168.101.19" , where john should be replaced
with your login at 192.168.101.19.

3) Type the password.

4) From C, if you ssh to your localhost (127.0.0.1 or 192.168.31.10) to port 999, a redirection will occur through 192.168.101.19 to 192.168.21.13 port 22 (ssh). I´m supposing you´re allowed to pass thorugh the gateway
using port tcp/22.


Try it.

hth
0
 

Author Comment

by:ealdaz
ID: 16883664
Thanks for the tip enyamada.
I've followed your instructions, it seems i'm doing something wrong as when i enter password i don't get any confirmation that the password is right, it just waits there. If i use a wrong password i am told it's the wrong one:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>plink -2 -T -L 999:192.168.21.13:22 -l john 192.168.101.19
Using username "john".
Using keyboard-interactive authentication.
Password:
Access denied
Using keyboard-interactive authentication.
Password:
^C
C:\>

If i use root, i get a bit further, do it ends with something that seems like an error.

C:\Documents and Settings\ealdaz\Desktop>plink -T -L 999:192.168.21.13:22 -l roo
t 192.168.101.19
Using username "root".
Using keyboard-interactive authentication.
Password:
stdin: is not a tty

I can ssh to 192.168.101.19 (A) from C so gateway i don't think is an issue here.

0
 

Author Comment

by:ealdaz
ID: 16883670
I forgot to add that in both cases when doing ssh with Putty to localhost thru port 999 the Putty terminal window just gets closed automatically after some seconds
0
Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 16884679
> I would like to connect to the machine B directly from C , is  this possible?
no, excpet these are class B IPs with a netmask of 255.255.0.0, or your machine C has a NIC on the same logical network as machine B

But I guess you mean something else with "connect directly". Could you please explain what you mean"
0
 
LVL 2

Expert Comment

by:enyamada
ID: 16884758
ealdaz,

Please, add the "-v" option to plink and try to change the port and post the output:

plink -2 -T -L 5001:192.168.21.13:22 -v -l john 192.168.101.19



After you type the correct password, check if locally the 5001 port is listening:

netstat -an | findstr 5001

Please, send the outputs.

tks
0
 

Author Comment

by:ealdaz
ID: 16885084
Hi Enyamada, it works perfectly, i had a little issue with the network on the C computer side that i've sorted out.
Thanks for your help !

0
 

Author Comment

by:ealdaz
ID: 16885104
Hi Ahoffmann
By connecting directly i meant been able to do an ssh to the remote host B directly from C without having to log first into A and then from A logging into B

Thanks !
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question