Philipp Marek
2021-Sep-07 09:06 UTC
Keeping or stopping TCP forwardings when the foreground process quits?
Hi, In my ~/.ssh/config I've got a few hosts with ControlMaster auto (for performance reasons, they're higher latency and cutting down reconnect time helps a lot). Now I started a TCP delay via the usual ssh user at host -L port:IP:port and when I no longer needed it, I quit the interactive shell. But the TCP forwards still worked - of course, as the ControlMaster process was still active! What I'd like to ask/discuss is -- perhaps the TCP forwarding should (optionally, by default) be bound to the interactive SSH process - and when that one quits, the forwarding is stopped? (When running with -f, SSH runs in the background anyway.) Or is that a bad idea?
Peter Stuge
2021-Sep-07 12:52 UTC
Keeping or stopping TCP forwardings when the foreground process quits?
Hi, Philipp Marek wrote:> But the TCP forwards still worked - of course, > as the ControlMaster process was still active! > > What I'd like to ask/discuss is -- perhaps the TCP forwarding should > (optionally, by default) be bound to the interactive SSH process - > and when that one quits, the forwarding is stopped?I'd also like such behavior, but I don't know if the session owner (the Master process) can reliably tell when a Slave process exits? A first step might be to enable Slave processes to not only add but also remove previously established channels? //Peter