Re: howto port forward w/out remote session?

From: Conrad Schilbe (cschilbe_at_securityfocus.com)
Date: 10/03/05

  • Next message: Derek Martin: "Re: Using ssh remote for a nohup process"
    Date: Mon, 03 Oct 2005 12:28:12 -0600
    To: sean <seandarcy2@gmail.com>
    
    

    Sean,

    from ssh man:

    -N Do not execute a remote command. This is useful for just
            forwarding ports (protocol version 2 only).

    -f Requests ssh to go to background just before command execution.
            This is useful if ssh is going to ask for passwords or
            passphrases, but the user wants it in the background. This
            implies -n. The recommended way to start X11 programs at a
            remote site is with something like ssh -f host xterm.

    Your ssh command then becomes:

    ssh -Nf -L 9100:printer:9100 user@gateway

    cheers,

    c

    sean wrote:
    > On openssh-4.2p1 I've set up port forwarding to a remote printer.
    >
    > office -> gateway -> printer
    >
    >
    > [office]$ ssh -L 9100:printer:9100 user@gateway
    >
    >
    > set cups on office to localhost:9100 and it works brilliantly, half a
    > world away.
    >
    > But...
    >
    > I can't figure out how to run the ssh command as part of office startup
    > - for instance in rc.local. The problem is that ssh opens up the
    > terminal window in gateway. And rc.local never completes.
    >
    > I've tried -o BatchMode=yes. No luck.
    >
    > I tried backgrounding:
    >
    > [office]$ ssh -L 9100:printer:9100 user@gateway &
    >
    > But then printing doesn't work and netstat shows :
    >
    >
    > [1]+ Stopped ssh -L 9100:printer:9100 user@gateway -o
    > BatchMode=yes
    >
    >
    > Any help appreciated.
    >
    > sean
    >


  • Next message: Derek Martin: "Re: Using ssh remote for a nohup process"