Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 01-21-2010, 03:42 PM   #1
Registered: Aug 2009
Posts: 87

Rep: Reputation: 16
SSH tunnel over SSH tunnel

I have a setup of 3 computer, 2 of which are servers, and am trying to set up a secure connection between them. The setup goes "my computer"->-"local server"->-"remote server". I currently have an ssh proxy set up to the local server from my computer. I would now like to set up another ssh proxy from my computer to the remote server, via the local server. Is this possible?
Old 01-22-2010, 09:19 AM   #2
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 100Reputation: 100
Can you explain in more details? What OS do you run? Can you ssh direct to remote from your computer?
Old 01-22-2010, 02:16 PM   #3
Registered: Aug 2009
Posts: 87

Original Poster
Rep: Reputation: 16
I am currently running Ubuntu 9.10. My computer is stuck behind a firewall, which is causing me problems, especially with ssh. The local server does not have this problem. I want to use an ssh tunnel (ssh -D 8080 -fCqN local-server) to the local server to be able to tunnel the ssh traffic around the problem firewall. In short I want the create one ssh tunnel, and then route a second ssh connection over the first tunnel.
Old 01-22-2010, 04:45 PM   #4
Registered: Nov 2009
Location: Alabama
Distribution: Arch x86_64
Posts: 650

Rep: Reputation: 78
if your computer is behind a firewall blocking ssh traffic out, then it doesn't matter where you are wanting to go, until you open port 22, your not going to be able to connect.
Old 01-22-2010, 04:54 PM   #5
Senior Member
Registered: Dec 2005
Distribution: Slackware -current, 14.2
Posts: 1,084

Rep: Reputation: 195Reputation: 195
Perhaps what you're attempting to do is similar to what's being attempted, and answered, here:

Old 01-22-2010, 05:29 PM   #6
Registered: Aug 2007
Location: Fort Collins, Colorado
Distribution: Gentoo
Posts: 64

Rep: Reputation: 17
Here's how I would do it:

In a free terminal:
computer# ssh local_server -L 2222:

local_server# ssh remote_server -L 2222:

Then, if you want to connect to the remote server directly, you can just connect to port 2222 on localhost.

For instance, if you want to proxy through the remote server: ssh -D 8080 -fCqN -p 2222 localhost
Old 01-22-2010, 06:25 PM   #7
Registered: Aug 2009
Posts: 87

Original Poster
Rep: Reputation: 16
Thanks everybody.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to tunnel everything over ssh iamacup Linux - Networking 1 06-30-2009 04:33 PM
ssh tunnel ramesh14 Linux - Newbie 2 12-30-2008 01:11 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 03:15 PM
ssh tunnel crep Linux - Networking 2 08-25-2004 08:24 PM
Ssh Tunnel tinaa Linux - Software 7 07-29-2003 07:52 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:05 PM.

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