I'm a mod on the Stackexchange site for Unix & Linux and someone recently posted this question there: https://unix.stackexchange.com/questions/459450/how-to-exit-openssh-control-master-process-without-using-lsof-or-fuser. I answered this question but noticed that the solution seemed like a bug. If I tried to check on the status of a control master like this, it failed: ``` $ ssh -o ControlPath=~/.ssh/master-57db26a0499dfd881986e23a2e4dd5c5c63e26c2 -O check usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-Q cipher | cipher-auth | mac | kex | key] [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]] [user@]hostname [command] ``` But if I provide it a bogus argument, such as, 'blah' it works as expected: ``` ssh -o ControlPath=~/.ssh/master-c0c363c21c2ab6e5754aad2eb0f73b87e8501565 -O check blah Master running (pid=14595) # ```
Yes - this is intentional. ControlPath may contain %-expansions that need a hostname to expand fully. We could conceivably check to see whether ControlPath actually needs this and make the hostname optional but 1) ControlPaths that use %h are common and 2) I'd rather not make the argument parsing code more of a maze than it already is.
OK, I can buy that. I'll update the question w/ your justification for those that may stumble upon this on the Internet. Thanks for getting back and clarifying. -Sam
closing resolved bugs as of 8.6p1 release