Silly SSH question

Josh Pollak pardsbane at offthehill.org
Sat Apr 2 13:36:31 EST 2005


I've got a silly question about ssh. I've been using the following line 
to open up a port forwarding tunnel:

ssh -L7000:hostname:80 -f -N uname at hostname

-N tells SSH not to execute a command (so I don't get a shell), and -f 
says to drop into the background as soon as its authenticated, which 
allows me to type my password and not have to type ctrl-z, 'bg'.

The question is, how do I cleanly kill this tunnel? I've been running 
'ps aux | grep ssh', finding the line and killing it, but that seems 
kludgy. Is there a 'right way' to do this? Even just having ssh return 
or save its pid somewhere?




More information about the Discuss mailing list