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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-14-2009, 12:23 PM
|
#1
|
Member
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49
Rep:
|
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.
|
|
|
11-14-2009, 12:31 PM
|
#2
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
|
|
|
11-14-2009, 12:53 PM
|
#3
|
Member
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49
Original Poster
Rep:
|
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.
|
|
|
11-14-2009, 01:03 PM
|
#5
|
Member
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49
Original Poster
Rep:
|
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.
|
|
|
11-14-2009, 02:04 PM
|
#6
|
Member
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49
Original Poster
Rep:
|
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!
|
|
|
11-16-2009, 02:41 PM
|
#7
|
LQ Newbie
Registered: Nov 2009
Location: Second Life
Distribution: Slackware, Ubuntu
Posts: 2
Rep:
|
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 02:42 PM.
|
|
|
All times are GMT -5. The time now is 10:44 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|