cmc
cmc copied to clipboard
Support different user and port with same host
On the same server, I'm running 2 SSH servers (one for regular SSH connection (port 22) and another one for container running on the host (port 2222 with admin user)). My configuration is given below.
.ssh/config
Host *
ControlMaster auto
ControlPersist 5m
ControlPath /tmp/%r@%h:%p
Host server_name
User user
/tmp
/tmp/admin@server_name:2222
/tmp/user@server_name:22
Result of ssh -O check
$ ssh -O check admin@server_name -p 2222
Master running (pid=75873)
$ ssh -O check server_name
Master running (pid=70100)
Resulting output of cmc -l
is incorrect
server_name
pid: 70100
start: 5:34PM
status: Master running
socket: /tmp/user@server_name:22
server_name
pid: 70100
start: 5:34PM
status: Master running
socket: /tmp/user@server_name:22
I've run into this issue as well. If the connection's username matches what's in ~/.ssh/config, it will list and close with -x
. If the connection does not match anything in ~/.ssh/config or $USER on the local system, it won't list or close with -x
.
A previous version of cmc would at least list all of the connections if the usernames match what's in ~/.ssh/config or $USER. -x
wouldn't close those connections, however -X
will. The current version will do neither. I'll just get a warning.
WARNING: no control socket found for host: github.com