In order to use SSH client session multiplexing, one must manually set up a ControlMaster which is rather annoying. I suggest adding a TcpFallback flag which allows the client to fall back to a regular TCP connection in case the ControlPath control socket doesn't exist. Furthermore I suggest adding a way to let a ControlMaster ignore an existing ControlMaster socket by simply becoming a client of it. These two options should make SSH client multiplexing completely transparently.
Created attachment 705 [details] Implementation of the suggested TcpFallback flag. It is a diff against the current in-tree OpenSSH as of August 25th. I sent this to djm@openbsd.org who suggested I added this as a bugreport here.
+ /* + * If we return to here, socket could not be opened. + * Check for TCP fallback and abort if disabled. + */ + + if (options.tcp_fallback == 0) + fatal("Couldn't connect to %s: %s", + options.control_path, + strerror(errno)); Not sure I like having the strerror(errno) so far away from the origination point. Rather see it inside the control_client(); Either return the error message as part of the char* or let the function call run 'error()' then fall out of the function to let some higher logic decided if other action should be taken. But I think if one askes to use a pipe and it doesn't exist. It should whine a bit louder than this patch if not create the pipe for future connections to use. Just something else to consider. - Ben
Created attachment 926 [details] Add automatic multiplexing option OpenSSH -current includes some fallback support from ControlMaster=no -> TCP connect. This patch adds the last piece: use an existing ControlMaster socket if one exists, but fallback (and create one) if it doesn't.
Created attachment 928 [details] Better manual diff Fixes some stuff in the man part of djm@'s diff: 1) New sentence, new line 2) Use .Dq for double quotes instead of "" I think .Dq should be replaced with .Pa whenever it is used for configuration parameters, but that is an unrelated change so I've kept it out of this diff.
(In reply to comment #4) > I think .Dq should be replaced with .Pa whenever it is used for configuration > parameters, but that is an unrelated change so I've kept it out of this diff. That should have said ``.Ar'', not ``.Pa''.
Applied to -current, will be in 4.2
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.