diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py index 9bf1c9ba24..86a2344f3e 100644 --- a/crmsh/bootstrap.py +++ b/crmsh/bootstrap.py @@ -887,8 +887,7 @@ def init_ssh_impl(local_user: str, ssh_public_keys: typing.List[ssh_key.Key], us for user, node in user_node_list: user_by_host.add(user, node) user_by_host.add(local_user, utils.this_node()) - for user, node in user_node_list: - change_user_shell('hacluster', node) + user_by_host.save_local() # Starting from here, ClusterShell is available shell = sh.ClusterShell(local_shell, UserOfHost.instance()) authorized_key_manager = ssh_key.AuthorizedKeyManager(shell) @@ -897,7 +896,9 @@ def init_ssh_impl(local_user: str, ssh_public_keys: typing.List[ssh_key.Key], us [node for user, node in user_node_list], 'hacluster', ) - user_by_host.save_remote([node for user, node in user_node_list]) + for user, node in user_node_list: + change_user_shell('hacluster', node) + user_by_host.save_remote([node for user, node in user_node_list]) def _init_ssh_on_remote_nodes(