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


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

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

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

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

B: ---- (eth1) |Linux Srv A| (eth0) ---|Gateway|--- C:

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
Question by:ealdaz
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

Accepted Solution

enyamada earned 2000 total points
ID: 16872097

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

1) From C, download plink (

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

3) Type the password.

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

Try it.


Author Comment

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: -l john
Using username "john".
Using keyboard-interactive authentication.
Access denied
Using keyboard-interactive authentication.

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: -l roo
Using username "root".
Using keyboard-interactive authentication.
stdin: is not a tty

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


Author Comment

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
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

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, 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"

Expert Comment

ID: 16884758

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

plink -2 -T -L 5001: -v -l john

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

netstat -an | findstr 5001

Please, send the outputs.


Author Comment

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 !


Author Comment

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 !

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