Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support different user and port with same host #8

Open
sestegra opened this issue May 24, 2021 · 1 comment
Open

Support different user and port with same host #8

sestegra opened this issue May 24, 2021 · 1 comment

Comments

@sestegra
Copy link

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
@chigh
Copy link

chigh commented Jul 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants