RE: running an (open)ssh session ONLY to forward ports.

From: Tobias Speckbacher (tobias_at_quova.com)
Date: 04/09/04

  • Next message: James Sinnamon: "Re: How to use ssh without requiring passwords each time"
    Date: Fri, 9 Apr 2004 13:01:38 -0700
    To: <secureshell@securityfocus.com>
    
    

    Wouldn't simply supplying the -f option do the trick ?
    Or am I missing something here ?

    -T

    -----Original Message-----
    From: Joerg Over Dexia [mailto:over@dexia.de]
    Sent: Thursday, April 08, 2004 7:34 AM
    To: secureshell@securityfocus.com
    Subject: Re: running an (open)ssh session ONLY to forward ports.

    Am 11:20 07.04.2004 -0700 teilte Julian Elischer mir folgendes
    mit:
    ->
    ->According to my reading of the man page, the command:
    ->
    ->ssh -L 5999:cvs.mynet.com:5999 -l me -n -N -T -x myserver
    ->
    ->should open a session to the sshd on myserver.
    ->(Assuming I have keys set up to allow the authentication).
    ->
    ->the session should just hang around with:
    ->-n with all input "disabled"
    ->-N No remote command executed.
    ->-T No remote pty allocated on the far end
    ->-x no X11 forwarded.
    ->and wait for connections on port 5999
    ->
    ->
    ->However, it doesn't seem to work that way.
    ->
    ->here> ssh -L 5999:cvs.mynet.com:5999 -l me -n -N -T -x myserver
    ->
    <snip>
    ->I don't want any shells or othre resources used on the server.
    Just an sshd
    ->forwarding my data.

    Hm, *my* man page doesn't know -T or -N (OpenSSH_3.7p1).
    You should specify platform and version, if you want specific
    help.

    Therefore, unspecific: You might do a
    ssh -L 5999:cvs.mynet.com:5999 -x myserver "sleep 600".
    You then got a 10 minutes sleep (which doesn't cost any
    remarkable cpu resources) which lets you establish the tunnel.
    Once the tunnel is established, the shell exits (freeing
    resources) and the ssh connection will end once you tear down the
    tunnel.

    Generally, not much reason to optimize further, I'd say. You can
    shorten the sleep, though. With cvs, otoh, you seem to want sth
    like a "permanent tunnel"... in that case I'd program a tiny
    shell for the server which just waits for ^C or something. Should
    be very low on resource consummation.

    Actually, in comparison with the resource the sshd consumes, all
    that should be rather neglectable.

    hth, JO


  • Next message: James Sinnamon: "Re: How to use ssh without requiring passwords each time"