Solved

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

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

Accepted Solution

by:
enyamada earned 500 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now