viewing a local website while SSH'd through 2 boxes? Linux

boredhokie

Senior member
May 7, 2005
625
0
0
Hello,

Sorry for the confusing topic but i'm not sure how else to explain it. I'm helping to set up a network monitoring package for an employer but I am working from home while on vacation. To get into the network I ssh to a gateway computer in linux (command line), and from that box i SSH to another computer on that local network (also linux command line), lets call it computer B. B has apache set up on it and I need to view a site that it is hosting. I have regular user access on computer A and root access on computer B.

I'm not familiar with VNC, but is there any way i could do this?

If the site were being hosted on computer A i could just setup a tunnel in PuTTy for localhost:80 and view it like that. I guess if i could figure out VNC, i could log into computer A and then use its web browser to load the website that's on computer B, because they're set up to see eachother.

any ideas?

 

Thyme

Platinum Member
Nov 30, 2000
2,330
0
0
If the ports are open, VNC would work.

If you need more than a text browser and the web is not server-side, you can use WinSCP to tunnel through SSH and download the HTML. You could also potentially redirect server-side output and download that. If you had to rigorously test a server-side site, VNC would probably work well.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Thyme
If the ports are open, VNC would work.

If you need more than a text browser and the web is not server-side, you can use WinSCP to tunnel through SSH and download the HTML. You could also potentially redirect server-side output and download that. If you had to rigorously test a server-side site, VNC would probably work well.

Why VNC when he can just tunnel the traffic through SSH? Tunneling something through 2 SSH sessions should work fine, I've done it with X11 at least.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
On the first connection, forward port 80 on your machine to port x on machine A where x > 1024. On the second connection, forward port x on machine A to port 80 on machine B.

Go to http://localhost/ in the browser on your machine. I think I've got that right...

Edit: Of course there's a simple way to do that. Just forward port 80 on your machine to port 80 of machine B, if machine A can see B:80. I think the OpenSSH shell syntax would be roughly:
ssh -L 80:machineB:80 you@machineA
The putty setup would be similar.

Edit2: Just noticed that you were so close to that solution when you said localhost:80 in your OP. Just substitute machineB for localhost.
 

boredhokie

Senior member
May 7, 2005
625
0
0
Thanks guys for your great answers, i'll be checking them out presently.

Also a clarification - apache on computer B is running server side stuff and i'm testing the authentication on it, so i'd need a standard web browser connection to it..