Skip to content

Commit

Permalink
Dev: ssh-agent: add informative logging for adding keys to authorized…
Browse files Browse the repository at this point in the history
…_keys
  • Loading branch information
nicholasyang2022 committed Oct 31, 2023
1 parent eed2e7f commit d234fa5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crmsh/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ def init_ssh_impl(local_user: str, ssh_public_keys: typing.List[ssh_key.Key], us
authorized_key_manager = ssh_key.AuthorizedKeyManager(shell)
if ssh_public_keys:
# Use specified key. Do not generate new ones.
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)
else:
Expand All @@ -879,7 +880,7 @@ def init_ssh_impl(local_user: str, ssh_public_keys: typing.List[ssh_key.Key], us
print()
if ssh_public_keys:
for user, node in user_node_list:
logger.info("Adding public key to authorized_keys on %s@%s", user, node)
logger.info("Adding public keys to authorized_keys on %s@%s", user, node)
for key in ssh_public_keys:
authorized_key_manager.add(node, local_user, key)
if user != 'root' and 0 != shell.subprocess_run_without_input(
Expand Down

0 comments on commit d234fa5

Please sign in to comment.