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
  • 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 (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

621 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