The remote shell and SOCKS-forwarded connections are separate channels on one SSH transport. Ending the shell does not necessarily finish the browser connections using the dynamic forward. OpenSSH documents waiting at logout for forwarded connections or X11 sessions to finish.

For an orderly exit, close the operations using the forward and allow their channels to end. Closing a browser window may leave background browser processes and connections running, so identify the process still using the listener.

For a suitable interactive session, the default OpenSSH escape commands can list forwarded connections or explicitly disconnect. Their availability depends on that session and its escape configuration; sending interactive escape text to a background ssh -N process is not a general shutdown interface.

Before interrupting the transport, identify whether a connection-sharing master owns it. Other sessions may depend on that same connection.

ExitOnForwardFailure governs failure to establish the requested forwarding setup. It does not define “exit after the last website request” or “terminate every channel when the shell ends.” The shutdown choice is whether to drain the remaining work or deliberately interrupt it.

Mikanda mikatakata