LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   SSH tunnel over SSH tunnel (https://www.linuxquestions.org/questions/linux-networking-3/ssh-tunnel-over-ssh-tunnel-783847/)

vockleya 01-21-2010 03:42 PM

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?

quanta 01-22-2010 09:19 AM

Can you explain in more details? What OS do you run? Can you ssh direct to remote from your computer?

vockleya 01-22-2010 02:16 PM

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.

bret381 01-22-2010 04:45 PM

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.

mrclisdue 01-22-2010 04:54 PM

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

http://www.linuxquestions.org/questi...neling-767875/

cheers

kinetic 01-22-2010 05:29 PM

Here's how I would do it:

In a free terminal:
Code:

computer# ssh local_server -L 2222:127.0.0.1:2222
Password:

local_server# ssh remote_server -L 2222:127.0.0.1:22
Password:

remote_server#

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

vockleya 01-22-2010 06:25 PM

Thanks everybody.


All times are GMT -5. The time now is 01:06 AM.