The man page for ssh says that there are these three commands you can run on multiplexing ssh sessions:

  • "cancel” (cancel forwardings)
  • “exit” (request the master to exit),
  • “stop” (request the master to stop accepting further multiplexing requests).

I think I know what "exit" does, because my pid goes away when I call it, when I call "cancel", lsof shows just my main ssh session and the rest of the port forwards disappear. But the same thing appears to happen if I call "exit" or "stop". So what is the difference between those?


exit will terminate all running muxed connections. stop will simply accept no further new muxed connections. If you have a session open, it will be terminated with exit, but will be left until autonomously closed with stop.

  • So if I want to boot people riding my connection, use exit, if I want to be nice I use stop? Jul 20 '17 at 20:46
  • Well, other people can't "ride" your connection (unless they are logged in as you), but if you have an active task open in another terminal, it will be killed off with exit, but not with stop. With the latter, when the final connection in use is dropped, the Control connection will self-terminate.
    – DopeGhoti
    Jul 20 '17 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.