[v7] Add tsh config
helper to generate OpenSSH client configuration (#7437)
#7651
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.
tsh config ssh
helper to generate OpenSSH client configurationThis adds a new subcommand,
tsh config ssh
, to generate OpenSSHclient configuration snippets that allow users to connect directly to
nodes using the standard
ssh
client.To support this change, tsh's
known_hosts
file has been modified tomatch the format required by OpenSSH when verifying hosts against
certificates. Old-style
known_hosts
entries will be automaticallyreplaced and pruned when the end user first logs in with an updated
tsh
. Small changes were additionally made to the keystore and keyagent to pass the proxy host into
AddKnownHostKeys
and to supportwildcard hostnames in
known_hosts
entries.Fix broken link to Trusted Clusters documentation
Use text/template for SSH config generation; wrap all errors.
Rename config helper from
config ssh
to justconfig
This changes the config helper to use just
tsh config
persuggestion from @r0mant.
Fix known_hosts_migrate_test after rebase
First pass at review feedback
Update docs/pages/server-access/guides/openssh.mdx
Co-authored-by: Roman Tkachenko [email protected]
Ensure top-level hostnames never match wildcard patterns
Add additional host count check to
canPruneOldHostsEntry
.Replace excess call to
isOldStyleHostsEntry
with documented invariantTrim trailing dots on absolute hostnames in
matchesWildcard
Co-authored-by: Roman Tkachenko [email protected]