Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: howto port forward w/out remote session?

Subject: Re: howto port forward w/out remote session?
Date: Mon, 03 Oct 2005 12:28:12 -0600
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


<Prev in Thread] Current Thread [Next in Thread>