URGENT: SSH reverse tunnel problem!!! - Help

This is a discussion on URGENT: SSH reverse tunnel problem!!! - Help ; On the machine "machineA" (RedHat Linux 9.0) I set up the following SSH tunnels to "machineB" (RedHat ES 4.0): ssh -c blowfish -f -L 7777:localhost:2049 -L 8888:localhost:4002 -R 1235:localhost:23 machineB sleep 60 Now when doing the following on machineB it ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: URGENT: SSH reverse tunnel problem!!!

  1. URGENT: SSH reverse tunnel problem!!!

    On the machine "machineA" (RedHat Linux 9.0) I set up the following SSH
    tunnels to "machineB" (RedHat ES 4.0):

    ssh -c blowfish -f -L 7777:localhost:2049 -L 8888:localhost:4002 -R
    1235:localhost:23 machineB sleep 60

    Now when doing the following on machineB it works fine:

    telnet localhost 1235

    I get a connection to machineA on port 1234. But when trying this:

    telnet machineB.domain.ch 1235

    I get the error: connection refused. Any idea why?

    I have tried to play with the /etc/hosts file on machineB. If I keep only
    the default line like this:

    127.0.0.1 localhost localhost.localdomain

    Then I get the above behaviour. When trying this:

    127.0.0.1 machineB localhost localhost.localdomain

    It works with 'telnet localhost 1235' and 'telnet machineB 1235'. But with
    the following:

    127.0.0.1 machineB machineB.domain.ch localhost
    localhost.localdomain

    I get a lot of problem and suddenly I have also problems with the forward
    tunnels!

    What should I change for both 'telnet localhost 1235' and 'telnet
    machineB.domain.ch 1235' to work? On machineA or machineB?

    Thanks a lot for any help.

    CÚdric



  2. Re: URGENT: SSH reverse tunnel problem!!!

    In article <1147367162.529399@ftpgate>, CÚdric Pillonel wrote:
    > On the machine "machineA" (RedHat Linux 9.0) I set up the following SSH
    > tunnels to "machineB" (RedHat ES 4.0):
    >
    > ssh -c blowfish -f -L 7777:localhost:2049 -L 8888:localhost:4002 -R
    > 1235:localhost:23 machineB sleep 60
    >
    > Now when doing the following on machineB it works fine:
    >
    > telnet localhost 1235
    >
    > I get a connection to machineA on port 1234. But when trying this:
    >
    > telnet machineB.domain.ch 1235
    >
    > I get the error: connection refused. Any idea why?
    >
    > I have tried to play with the /etc/hosts file on machineB. If I keep only
    > the default line like this:
    >
    > 127.0.0.1 localhost localhost.localdomain
    >
    > Then I get the above behaviour. When trying this:
    >
    > 127.0.0.1 machineB localhost localhost.localdomain
    >
    > It works with 'telnet localhost 1235' and 'telnet machineB 1235'. But with
    > the following:
    >
    > 127.0.0.1 machineB machineB.domain.ch localhost
    > localhost.localdomain
    >
    > I get a lot of problem and suddenly I have also problems with the forward
    > tunnels!
    >
    > What should I change for both 'telnet localhost 1235' and 'telnet
    > machineB.domain.ch 1235' to work? On machineA or machineB?


    Try 'netstat -an | grep :1235' or 'lsof -i TCP:1235' and see which addresses
    are being listened on. I suspect that using 'localhost' in that tunnel causes
    ssh to *only* listen on 127.0.0.1, where your host name "machineB" should be a
    different IP address associated with its NIC.

    Additionally, what are you using for hostname resolution (see "hosts:" in
    /etc/nsswitch.conf")?

    Kevin
    --
    Unix Guy Consulting, LLC
    Unix and Linux Automation, Shell, Perl and CGI scripting
    http://www.unix-guy.com

  3. Re: URGENT: SSH reverse tunnel problem!!!

    Here is what netsat give me:

    tcp 0 0 127.0.0.1:1235 0.0.0.0:* LISTEN
    tcp 0 0 ::1:1235 0.0.0.0:* LISTEN

    It seems that ssh always only listen on localhost.

    From the ssh client I tried the following:

    ssh -c blowfish -f -R 1235:machineB.domain.ch:23 machineB sleep 60
    instread of
    ssh -c blowfish -f -R 1235:localhost:23 machineB sleep 60

    but I don't see any difference with netstat, ssh always listen on localhost.

    Then when from a machineC I try: telnet machineB 1235
    I get always connection refused!

    In /etc/nsswitch.conf I have the following line for hostname resolution:
    hosts: files dns

    And in /etc/hosts:
    127.0.0.1 localhost localhost.localdomain

    I have also tried to add the follwing line in /etc/hosts:
    193.5.229.182 machineB.domain.ch machineB

    But still doesn't work!!!!
    Please help!

    Thank you.
    CÚdric

    "Kevin Collins" wrote in message
    news:slrne67dkb.hg3.spamtotrash@halo.unix-guy.com...
    > In article <1147367162.529399@ftpgate>, CÚdric Pillonel wrote:
    > > On the machine "machineA" (RedHat Linux 9.0) I set up the following SSH
    > > tunnels to "machineB" (RedHat ES 4.0):
    > >
    > > ssh -c blowfish -f -L 7777:localhost:2049 -L 8888:localhost:4002 -R
    > > 1235:localhost:23 machineB sleep 60
    > >
    > > Now when doing the following on machineB it works fine:
    > >
    > > telnet localhost 1235
    > >
    > > I get a connection to machineA on port 1234. But when trying this:
    > >
    > > telnet machineB.domain.ch 1235
    > >
    > > I get the error: connection refused. Any idea why?
    > >
    > > I have tried to play with the /etc/hosts file on machineB. If I keep

    only
    > > the default line like this:
    > >
    > > 127.0.0.1 localhost localhost.localdomain
    > >
    > > Then I get the above behaviour. When trying this:
    > >
    > > 127.0.0.1 machineB localhost localhost.localdomain
    > >
    > > It works with 'telnet localhost 1235' and 'telnet machineB 1235'. But

    with
    > > the following:
    > >
    > > 127.0.0.1 machineB machineB.domain.ch localhost
    > > localhost.localdomain
    > >
    > > I get a lot of problem and suddenly I have also problems with the

    forward
    > > tunnels!
    > >
    > > What should I change for both 'telnet localhost 1235' and 'telnet
    > > machineB.domain.ch 1235' to work? On machineA or machineB?

    >
    > Try 'netstat -an | grep :1235' or 'lsof -i TCP:1235' and see which

    addresses
    > are being listened on. I suspect that using 'localhost' in that tunnel

    causes
    > ssh to *only* listen on 127.0.0.1, where your host name "machineB" should

    be a
    > different IP address associated with its NIC.
    >
    > Additionally, what are you using for hostname resolution (see "hosts:" in
    > /etc/nsswitch.conf")?
    >
    > Kevin
    > --
    > Unix Guy Consulting, LLC
    > Unix and Linux Automation, Shell, Perl and CGI scripting
    > http://www.unix-guy.com




  4. Re: URGENT: SSH reverse tunnel problem!!!

    Bill Marcum writes:
    >On Fri, 12 May 2006 10:16:44 +0200, CÚdric Pillonel
    > wrote:
    >> Here is what netsat give me:
    >>
    >> tcp 0 0 127.0.0.1:1235 0.0.0.0:* LISTEN
    >> tcp 0 0 ::1:1235 0.0.0.0:* LISTEN
    >>
    >> It seems that ssh always only listen on localhost.
    >>

    >What is the ListenAddress in /etc/ssh/sshd.conf?
    >


    man sshd_config

    Read up on GatewayPorts configuration variable.

    scott

  5. Re: URGENT: SSH reverse tunnel problem!!!

    The default for GatewayPorts is "no", I turned it to "yes" and now
    everything works.

    Thank you very much.


    "Scott Lurndal" wrote in message
    news:N619g.16062$Lm5.8580@newssvr12.news.prodigy.c om...
    > Bill Marcum writes:
    > >On Fri, 12 May 2006 10:16:44 +0200, CÚdric Pillonel
    > > wrote:
    > >> Here is what netsat give me:
    > >>
    > >> tcp 0 0 127.0.0.1:1235 0.0.0.0:* LISTEN
    > >> tcp 0 0 ::1:1235 0.0.0.0:* LISTEN
    > >>
    > >> It seems that ssh always only listen on localhost.
    > >>

    > >What is the ListenAddress in /etc/ssh/sshd.conf?
    > >

    >
    > man sshd_config
    >
    > Read up on GatewayPorts configuration variable.
    >
    > scott




+ Reply to Thread