Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 8
    Once the tunnel is set up, how do you close it with this method? Commented Dec 7, 2015 at 8:02
  • @magnetik Find the process with ps and kill it Commented Dec 8, 2015 at 8:45
  • 27
    @magnetik and @neu242 the better is to use "master socket" ssh -N -f -M -S /tmp/file-sock -L port:server:port_to user@... so you can kill the connexion later with ssh -S /tmp/file -o exit user@.... (or kill). That way, no need to ps. You can tell to automatically create that file in ~/.ssh/config. Commented Dec 14, 2015 at 13:47
  • 3
    I mean "control socket" and not "master socket" Commented Dec 14, 2015 at 13:56
  • 19
    It should be ssh -S /tmp/file-sock -O exit, not -o en.wikibooks.org/wiki/OpenSSH/Cookbook/… Commented Apr 1, 2016 at 15:08