Redirection issue

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I'm trying to get redirection working between a couple of Linux
boxes and having trouble.  I've been beating my head against
google but either my problem is somewhat unique (unlikely) or
my search terms are wanting (likely).

Basically, I have redirection sort-of working; using rsa
keys and the command

#root@client>  ssh -l user -i ./my_rsa -R 5555:client:23 host

I can get redirection working fine... from the host's "localhost"
address!  However, using the machine's ip address on the network
(or its hostname) will get me a "Connection refused" message.

Wrong Avenue:

I thought perhaps it was a firewall issue, but it's not:

 - I get the same result from both the outside world and on the
   host server itself (telnet localhost 5555 vs. telnet host
   5555 or telnet 5555)

 - I attached a simple socket reader to port 5555 and can then
   make a tcp connection from both the outside world and from the
   host itself (to its actual network ip or hostname)


Client has: OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
            Linux client 2.4.26 #6 Mon Jun 14 19:07:27 PDT 2004
             i686 unknown unknown GNU/Linux

Host has: sshd version OpenSSH_3.5p1
          Linux host 2.4.20-24.9 #1 Mon Dec 1 11:35:51 EST 2003
           i686 i686 i386 GNU/Linux

Anyone have a clue or two they could bestow upon me?

Hope I'm not missing anything obvious.


"If you water incompetence, what grows out of it?"  
                                      --Rick Aristotle Munarriz

Re: Redirection issue

Followup info:

Netstat reports the redirected port as

and not

Not sure if this clue is an obvious result of the symptom or a
pointer toward a fixable cause. :)

"Your powers are much less than your dreams of reason would have
you believe."       --Michael Crichton

Re: Redirection issue

ssh -g ...

  Richard Silverman

Re: Redirection issue

Quoth Richard E. Silverman, Nevermore! And furthermore,

Quoted text here. Click to load it

Amending the command to

ssh -g -l user -i ./my_rsa -R 5555:client:23 host

yeilds the same results I described previously.

Which is a shame, as I would rather heap shame upon myself in exchange
for a fast solution than be a diligent and righteous person with an
unsolved problem.

Some agency is protecting me from a disturbing pleasure I would enjoy
too much.   --Nik Maack

Re: Redirection issue

Got it:

I needed to add:


to the sshd_config file on the host side.

I had a bully time finding that answer!  I finally saw a definitive reference
at which lit the light
bulb over my head.

For Mr. Silverman, who did attempt to answer my question: the -g option only
seems to work for local (-L) redirects and does not pass any information to
the remote daemon (as with the -R option).  The Gatewayports=yes option in
the config globally sets the equivalent of "-g" on the remote server.

I'm not sure if that now means any and all local (-L) redirects executed
on that system will now assume -g or not.  Will test and reply back if
it does (as that would be somewhat alarming).

Thanks again,

"Few users will like an error message no matter how well it is designed."
   --Roger S. Pressman, _Software Engineering: A Practitioner's Approach_

Site Timeline