LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   View webpage from server, connected via ssh.... (https://www.linuxquestions.org/questions/linux-newbie-8/view-webpage-from-server-connected-via-ssh-769135/)

Karas 11-14-2009 12:23 PM

View webpage from server, connected via ssh....
 
Apologies for the not so great thread title, but I was unsure as how to shorten my issue to a few words.

Basically, I am at home on a windows box, connecting to a slackware box via ssh, then within that connection I am connecting to another slack box with ssh again, the reason for this is that the the second machine (machine B) is not directly connected to the internet, it uses a proxy via the first box (machine A) to view the outside world. But on machine B are my webpages which I would like to view from home on my windows box (machine C).

Is this possible? My lecturer did something similar I am sure, but I am unable to duplicate it....

Any help would be greatly appreciated.

Thanks in advance.

repo 11-14-2009 12:31 PM

You can use vlc, or use X over sh
http://www.vanemery.com/Linux/XoverSSH/X-over-SSH2.html
http://www.cyberciti.biz/faq/linux-u...rely-over-ssh/

Karas 11-14-2009 12:53 PM

Im using putty at the moment, and I am not really worried about a GUI, I'd just like to be able to view the pages that machine B is serving.

repo 11-14-2009 12:57 PM

If you don't want a GUI, use lynx, text-only Web browser
http://en.wikipedia.org/wiki/Lynx_%28web_browser%29
It should be installed by default.

Karas 11-14-2009 01:03 PM

Sorry, I am terrible at explaining, I mean view the pages from machine B, on machine C's (My PC) web browser... I thought you meant the Linux OS GUI.

Karas 11-14-2009 02:04 PM

No worries, I found a solution:-

In putty, enter in the tunneling section

source port: 1521
destination: localhost:1521

This will forward Machine A's pages.

Then SSH into Machine B. The machine with the pages you want to view.

Then type:

ssh -N -f -L 1521:localhost:80 username@machineB

Sometimes you can get away with just entering the machine name, or you can login to Machine B first, and then do the above without the last bit. Either way you'll be prompted for a password I believe.

Then, for anyone who's not sure how to view this all on your browser:-

I forwarded Machine B's stuff to IE6, as I use FireFox for proper web browsing. But I would imagine the settings are the same.

tools > internet options > Connections > LAN Settings

Tick "Use a proxy server for your LAN"

Then enter in address "localhost" and port, yep, you guessed it "1521".

Click Advanced, ensure "Use the same proxy for all protocols" is ticked.

A small note, I am unsure if this applies or not, but in the Exceptions section, I removed the localhost entry, so that I could infact view the localhosts main page of Machine A, then Machine B. I don't know if you have to, or if you can enter another address, perhaps an IP. But for my situation I did, and it works. But, if not, just paste it back in!

millerrocks 11-16-2009 02:41 PM

In Linux I would do it like this:

Code:

ssh user@machineA -L 1521:machineB:80
which would connect me from my laptop/whatever to machineA over SSH whilst also forwarding port 1521 on my laptop to port 80 on machineB. I could then point my browser at http://localhost:1521 to see the web pages on machineB.

To do this in PuTTY:
  • Set up the SSH connection to machineA in the regular session dialogue window (the default window that PuTTY shows when you run it).
  • Then click on the little + sign next to SSH in the menu on the left, look for "Tunnels" and click on that to show the Tunnels dialogue.
  • Put 1521 in the Source Port box
  • Put machineB:80 in the Destination box (for example 192.168.200.10:80)
  • Hit Add
  • Hit open

When the login for machineA appears in PuTTY, give your username and passwd as usual. You can now point your browser at http://localhost:1521 as before.

I have a short tutorial on it with screenshots at:
http://loganslab.logspark.com/?p=4


All times are GMT -5. The time now is 11:59 PM.