-
Notifications
You must be signed in to change notification settings - Fork 95
Dev: bootstrap: use ssh agent by default #1728
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
Dev: bootstrap: use ssh agent by default #1728
Conversation
81e6dce to
f03db3f
Compare
f03db3f to
b9ff708
Compare
7332dff to
cf767a3
Compare
4e1ebb5 to
3f12ab8
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9a5f3aa to
9b62c6a
Compare
Use CasesBootstrapping with ssh-agentBootstrapping without ssh-agentBootstrapping with
|
| logger.info("Adding public keys to authorized_keys for user %s...", local_user) | ||
| for key in ssh_public_keys: | ||
| authorized_key_manager.add(None, local_user, key) | ||
| logger.info("Added public key %s.", key.fingerprint()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
info level, or debug for fingerprint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we allow to use keys from either ssh-agent or local key files, I think it is needed to show which key is actually used in the UI.
51e1f17 to
413fb76
Compare
and use-ssh-agent by default
… merging authorized_keys (ClusterLabs#1663) As we now allow to use either ssh-agent or local key files (unless --no-use-ssh-agent is specified), we cannot expect there are local key files on remote nodes. As a result, we cannot swap ssh keys by fetching key files from remote. Instead, we swap keys by merging authorized_keys.
…Labs#1633) as we allow to mix agent-based and key file based authentication.
413fb76 to
6869846
Compare
…rLabs#1663) We support using ssh-agent only when keys are already added to authorized_keys. Otherwise, we use ore generate local key files.
794c18d to
439f896
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Three use cases verified:
- normal 2-node bootstrap
- bootstrap qdevice
- crm cluster copy
439f896 to
1f72896
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the nice work!
ssh-copy-iduses public keys from ssh-agent by default if available. This pull request changes the behavior of ssh bootstrapping in crmsh to keep consistent withssh-copy-id.Changes
Option
--use-ssh-agentis changed to default ON, and users can opt out with--no-use-ssh-agent.crmsh will not report an error when environment variable
SSH_AUTH_SOCKis not set, or the agent provides no keys. Instead, it fallbacks to using or generating local key files. Andno_generating_ssh_keysis removed fromcrm.conf.crmsh will always relay environment
SSH_AUTH_SOCKaccross su/sudo boundary. (Previous behavior is not to relay ifno_generatring_ssh_keysis set.)Close #1633.