Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Please help creating ssh string (port forwarding)

Please help creating ssh string (port forwarding)
Thread Tools
peterthorn
Dedicated MacNNer
Join Date: Oct 2000
Location: Copenhagen, Denmark
Status: Offline
Reply With Quote
Apr 27, 2006, 03:42 PM
 
I have to access a server quite far away, but can't create the right ssh string, so I beg for help

The servers IP is (to illustrate the example) 123.456.789.012. I can connect with "ssh [email protected]" and enter the password, and it works. The problem is that I want to connect to the router at 192.168.1.2, via a browser, when I am connected to 123.456.789.012, and I can't figure that out.
I have tried to connect with this "ssh [email protected] -L 8080:192.168.1.2:80" and then connect to 192.168.1.2:8080, but it won't work.

TIA,
Peter

Forgot to mention - the servers internal IP is 192.168.1.5
( Last edited by peterthorn; Apr 28, 2006 at 03:51 AM. )
     
Rainy Day
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Apr 28, 2006, 05:16 AM
 
If you Google for this, you will find answers.

This might help too: The Secure Shell FAQ
     
JasonPro
Fresh-Faced Recruit
Join Date: Jan 2003
Status: Offline
Reply With Quote
May 4, 2006, 08:19 AM
 
Originally Posted by peterthorn
I have to access a server quite far away, but can't create the right ssh string, so I beg for help

The servers IP is (to illustrate the example) 123.456.789.012. I can connect with "ssh [email protected]" and enter the password, and it works. The problem is that I want to connect to the router at 192.168.1.2, via a browser, when I am connected to 123.456.789.012, and I can't figure that out.
I have tried to connect with this "ssh [email protected] -L 8080:192.168.1.2:80" and then connect to 192.168.1.2:8080, but it won't work.

TIA,
Peter

Forgot to mention - the servers internal IP is 192.168.1.5
use "ssh -L 8080:192.168.1.2:80 [email protected]"
and then point your browser to http://localhost:8080/ to make the connection.

Additionally, if you are already connected to the server using ssh you can press enter and then ~c for the ssh command prompt. At that you can enter "-L 8080:192.168.1.2:80" to create a port forwarding connection in the middle of a session.
     
   
Thread Tools
 
Forum Links
Forum 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 On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:55 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,