LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-30-2003, 07:10 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
A little question to an SSH guru (port forwarding)


I have the following setup:
serverA - internet - serverB - serverC

I do on serverA:
ssh -L10000:serverC:10000 serverB

This will connect localhost:10000 of serverA to serverC:10000.
Since the connection is made to localhost, it can only be used locally, on serverA itself (so far as I know).

Is there a way to establish the connection in a way that any machine close to serverA can make use of it?
i.e. to connect serverA:10000 to serverC:10000, so that any client (even if not having ssh) connecting to serverA:10000 would actually connect to serverC:10000?
 
Old 10-31-2003, 02:30 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
If I understand what you want to do - you need to edit sshd_config and set "GatewayPorts" to yes.
 
Old 10-31-2003, 04:28 PM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Thanks, it seems to be just what i need.

I wonder, however, how this exactly works on internet gateways? I mean: does it forward port lo:10000, iif:10000, oif:10000, or all? (You might have found out: I would prefer oif:10000 not being forwarded)
Also if it is possible to allow GatewayPorts on a per-forwarding-basis, i.e. GatewayPorts should not be enabled for all port forwarding, only for specific ones.

Last edited by J_Szucs; 10-31-2003 at 04:30 PM.
 
Old 11-01-2003, 07:59 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
As far as I know it needs to be on for all ports unless you run 2 sshd servers on different ports each with a different config. I also don't think there is a way to only bind to one interface so you'll need to use iptables to stop connections to the external interface.
 
  


Reply


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
ssh port forwarding question lmcilwain Linux - Networking 4 09-29-2005 02:32 PM
SSH Port Forwarding wwnexc Linux - Networking 4 09-29-2005 01:26 AM
SSH Port forwarding WRSpithead Linux - Networking 1 04-18-2005 04:09 AM
ssh port forwarding (tunneling?) question podollb Linux - Software 4 10-20-2004 01:12 AM
Help with Port Forwarding for SSH mi6 Linux - Networking 6 07-29-2003 12:46 PM


All times are GMT -5. The time now is 09:33 AM.

Main Menu
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