[FEAT] host-specific ssh keys for cockpit container #20904
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to set host-specific ssh keys via env-var in the cockpit-ws container.
Users can pass environment variables in the format of
COCKPIT_SSH_KEY_PATH_{HOSTNAME}
, whereHOSTNAME
is the hostname used in theConnect to
field of the cockpit login page, and cockpit will use the configured key to login to the host. If no host-specific key is set, it falls back to using theCOCKPIT_SSH_KEY_PATH
environment variable.I still need to make a unit test, but I wanted to ask for suggestions as to the best route. The cockpit bastion test could be replicated, or it could be refactored to test host-specific keys. I wasn't sure what the best approach would be, and would appreciate any advice before proceeding!
This functionality will enable users to login to multiple hosts via ssh keys once the host-switcher is deprecated, providing a solution to user concerns such as #20901