LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 11-14-2009, 01:23 PM   #1
Karas
Member
 
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49

Rep: Reputation: 15
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.
 
Old 11-14-2009, 01:31 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
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/
 
Old 11-14-2009, 01:53 PM   #3
Karas
Member
 
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49

Original Poster
Rep: Reputation: 15
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.
 
Old 11-14-2009, 01:57 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
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.
 
Old 11-14-2009, 02:03 PM   #5
Karas
Member
 
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49

Original Poster
Rep: Reputation: 15
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.
 
Old 11-14-2009, 03:04 PM   #6
Karas
Member
 
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49

Original Poster
Rep: Reputation: 15
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!
 
Old 11-16-2009, 03:41 PM   #7
millerrocks
LQ Newbie
 
Registered: Nov 2009
Location: Second Life
Distribution: Slackware, Ubuntu
Posts: 2

Rep: Reputation: Disabled
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

Last edited by millerrocks; 11-16-2009 at 03:42 PM.
 
  


Reply

Tags
ssh, tunnel


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
Hello, i connected a server by type 'ssh username@remotehost' in ubuntu's terminal sxluck Linux - Newbie 1 09-06-2009 04:36 PM
How can I hide my identity while connected with ssh server kingkazmi1988 Linux - Newbie 2 11-09-2007 06:30 PM
connected to my server with ssh juanb Linux - Newbie 2 10-04-2005 07:17 PM
why am i not able to view my webpage from outside my LAN yusha Red Hat 6 09-06-2004 10:09 AM
cannot view webpage tony yu Mandriva 7 10-10-2003 07:10 AM


All times are GMT -5. The time now is 02:51 AM.

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