Without resorting to 'killall ssh', how do I terminate an ssh process running in the background (using the '-f' switch)?
I connect to my computer at work using a tunnel. Here's how I open the tunnel to my machine through the gateway server:
ssh -fNL 12345:my_machine:22 my_login@gateway_server
This opens the tunnel and goes into the background. I then connect to my machine by ssh -p 12345 my_local_\login@localhost. Everything works great.
However, if after getting my work done, how do I close the tunnel I opened in the background? So far, I've been using 'killall ssh' or (if I have multiple ssh connections in progress, kill pid, but is there a simpler way to terminate a ssh process running in the background?
About this post
- Posted
- Archived
- Score
- 0 · 100% up
- Kind
- Text
- ID
- datlb