LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-06-2013, 07:50 AM   #1
greyarea
LQ Newbie
 
Registered: Jan 2008
Distribution: Centos5/RHEL5
Posts: 27

Rep: Reputation: 0
SSH tunnel to remote host


Hi,

I'm trying to reach a JBoss administration port on a host where I do not have a direct connection. I though I'd set up an ssh tunnel to another machine on the network but I'm having some difficulty.

In the diagram below I am connecting to a host with a SNAT address and attempting to forward local port 10105 to the 9990 port on 10.0.0.50 with is reachable from 10.0.0.40 (1.2.3.4).

I've tried a few ssh client options but the one that seems to fit is:

ssh -L 10105:10.0.0.50:9990 user@1.2.3.4

If I then try to open a browser to localhost:10105 I fail to connect. Can someone help?

Click image for larger version

Name:	Putty Tunnel.png
Views:	27
Size:	40.0 KB
ID:	14155
 
Old 12-06-2013, 10:03 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Can you access your machine directly from 10.0.0.50? If so, you can set up a reverse tunnel. From 10.0.0.50:
Code:
ssh -R 10105:127.0.0.1:9990 user@homemachine
Then from your home machine you could go to localhost:10105

You could also try setting up a proxy tunnel to 10.0.0.40 so your web traffic passes through that machine. Something like:
Code:
ssh -ND10105 user@1.2.3.4
Then you could launch your browser using the tunnel as a proxy server. For google chrome that would look like:
Code:
google-chrome --proxy-server="socks://localhost:10105"
Any address you go to in that browser session will behave like you're doing it on 10.0.0.40, so you should be able to go to http://10.0.0.50:9990 to access the page you're looking for. This is a good way to encrypt your web traffic when on an unsecured wireless network as well.

Last edited by suicidaleggroll; 12-06-2013 at 10:19 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Send X11 over LAN into remote SSH tunnel miketosh Linux - Newbie 3 09-10-2012 02:35 PM
What host does an SSH revers tunnel connect as? fhsm Linux - Networking 7 05-04-2012 10:40 PM
Remote use of rosetta stone via rdp, an ssh tunnel and pulseaudio tonyr8888 General 3 04-25-2012 10:03 PM
Connect to a proxy through a middle host with a ssh tunnel iacchi Linux - Networking 3 02-16-2012 12:02 PM
Remote Desktop using SSH tunnel..... help! redhatbeatswin Linux - Newbie 5 08-14-2004 11:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration