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

Posted on 2006-06-09
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
  • 4
  • 2

Accepted Solution

enyamada earned 500 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

830 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