[crmsh-4.6] Fix: bootstrap: ssh public key should be copied to qnetd node when ssh-agent feature is not enabled (bsc#1228950) #1515
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.
Problems
When running
crm cluster init qdevice --qnetd-hostame <qnetd-node>
with an environSSH_AUTH_SOCK
, even if--enable-ssh-agent
is not specified, crmsh will use that ssh-agent forcheck_ssh_passwd_need
. If the ssh-agent provides a key enabling passwordless ssh authentication to the<qnetd-node>
, the ssh public key of the<init-node>
will not be added to theauthorized_keys
of<qnetd-node>
.This makes the ssh authentication between
<init-node>
and<qnetd-node>
to depend on ssh-agent. It is unexpected and causes problems. For example, when a new node joins without ssh-agent, the new node needs the help of<init-node>
to copy its ssh public key to<qnetd-node>
(by runningcrm cluster init qnetd-remote <new-node>
on<init-node>
). This will fail as the<init-node>
cannot get ssh access to<qnetd-node>
without ssh-agent.Fixes
When ssh-agent support is not enabled, drop environ
SSH_AUTH_SOCK
before checking whether passwordless ssh is available.