3

I connect to a linux server over 2 other server:

MyPC --(ssh)--> serverA --(ssh)--> serverB --(ssh)--> FinalServer

httpd is running on FinalServer, listen on 80 serverA/serverB only accept port 22, sshd service

Is there any way to access FinalServer on myPC like this:

myPC> curl http://127.0.0.1:80
Hi , this is FinalServer Httpd Service!!
myPC> 

Thank you a lot!!

Wendal Chen
  • 258
  • 3
  • 11

1 Answers1

4

In principle, you would only need to tunnel port 80 at every ssh.

So, at every step: ssh -L80:localhost:80 <next-host>.

However, you will not be able to tunnel port 80 (and all ports < 1024) without root privileges, so you'll have to use a different port for this.

cornuz
  • 2,678
  • 18
  • 35
  • You can use ports above 1024 in the intermediary boxes, and point to :80 on MyPC (assuming root privs on it) – Alex Mar 12 '12 at 15:15