LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-24-2007, 02:03 PM   #1
Ratclaws
Member
 
Registered: Sep 2001
Location: New York
Distribution: Slackware 8
Posts: 102

Rep: Reputation: 16
Trouble with ssh port forward (bind address)


I would like to create a port forward to direct a port from one box to another. But, I want others on my network to be able to use the tunnel on my box. SSH is currently binding the port forward to localhost. How can I fix this using CentOS 4 (openssh 3.9)


Here is the the tunnel that currently works (but only on localhost)
Code:
ssh -f -q -N -L80:remotewebserver:80 user@remote

In BSD I can place a bind host in addition to the bind port
-LlocalIP:80:remotewebserver:80


I looked at the man page and saw that there is a bind address flag '-b' but I cannot get that to work.
(Yes, I am doing this as root)

ssh -f -q -N -b localip -L80:remotewebserver:80 user@remote
(still only binds to localhost).
 
Old 04-24-2007, 02:24 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Look at the '-g' flag as well as the BindAddress option (or you can, as in BSD, supply local_iport:remoteort).
 
Old 04-24-2007, 04:20 PM   #3
Ratclaws
Member
 
Registered: Sep 2001
Location: New York
Distribution: Slackware 8
Posts: 102

Original Poster
Rep: Reputation: 16
-g - that did it.. Never would have seen that.

As for prepending the hostname, it works on bsd, and does not like the syntax on linux. Looking at the man page, the version from centos does not make any mention that you can specify hostname.


Thank you very much.
 
Old 04-24-2007, 05:26 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Odd, my manpages (Ubuntu) do show the hostname. But in any case, -g usually works.
 
  


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
Setting up SSH to bind to one and only one IP address Harlin Linux - Networking 5 06-07-2006 07:16 AM
SSH port forward problem idsdown Linux - Networking 2 11-25-2005 12:47 AM
ssh port forward failure harmster Linux - Networking 2 03-08-2004 06:46 AM
how to forward port to another address cmardhekar Linux - General 1 08-25-2001 09:08 AM
port forward over ssh bedwardj Linux - Security 1 06-26-2001 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:52 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
Open Source Consulting | Domain Registration