0

I am looking at different samples for configuring ssh config to support Bastion connection to my cloud's internal servers.

I'v hae encountered several (working) samples having the prefix "mux-" on the ControlPath configuration -

For example:

#ssh_config
#use with ssh -F ssh_config user@<TARGET_SERVER_IP>
Host *
    ServerAliveInterval    60
    TCPKeepAlive           yes
    ProxyCommand           ssh -q -A gmasgras@<JUMP_SERVER_IP> nc %h %p
    ControlMaster          auto
    ControlPath            ~/.ssh/mux-%r@%h:%p
    ControlPersist         8h
    User                   ubuntu
    StrictHostKeyChecking  no

source

I can't find any explanation regarding the "mux-" prefix, along with the %r@%h:%p suffix (%r=remote user, %h=host, %p=port). The combination is clearly not an actual ssh public key in the ssh folder.

In other sample ControlPath variations, people are also using:

ControlPath ~/.ssh/ssh-mux-%r@%h:%p

or

ControlPath /tmp/ssh-%r@%h:%p

or

ControlPath ~/.ssh/cm-%r@%h:%p

or even

ControlPath ~/.ssh/ansible-%r@%h:%p

Can you provide an explanation for the prefix convention? ("mux-", "ssh-mux-", "ansible-")

1

The answer is that the ControlPath creates a file on your local machine, with the pattern ~/.ssh/XXX-%r@%h:%p, according to the config you set.

The string is arbitrary, that's why it is not documented anywhere.

The definitions for the ControlPath from this article:

The ControlPath entry specifies where to store the “control socket” for the multiplexed connections. In this case, %r refers to the remote login name, %h refers to the target host name, and %p refers to the destination port. Including this information in the control socket name helps SSH separate control sockets for connections to different hosts.

Indeed if you navigate to ~/.ssh/ folder, you'll find a file created automatically when the Bastion connection happen.

(FYI: Bastion is also referred to as Jumphost)

0

While the name is arbitrary, as @orberkov mentions, people name them as mux because mux is a known shorthand coming from electronics jargon, meaning a multiplexer. The other names such as ansible, or others, are more named on the use people are giving to those sockets.

As for their time of life, they are present while the socket is active, and then are deleted.

Basically, you just want to name them on a convention that defines a name that is visible and recognized for the purpose, while guaranteeing you have a unique name for each different socket.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.