An administrator has generated an SSH key pair and now needs to distribute the public key to several servers. The goal is to append the key to each user’s existing authorized_keys file without manual copying or file editing. Which utility best accomplishes this task?
ssh-copy-id connects to the target host using the administrator's credentials and appends the local public key to ~/.ssh/authorized_keys automatically, preserving any existing keys. Using scp to copy the key risks overwriting or misplacing permissions. ssh-add only loads a private key into the local SSH agent. ssh-keygen only creates key pairs and does not handle key distribution.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is SSH and why is it used?
Open an interactive chat with Bash
What is authorized_keys and how does it work?
Open an interactive chat with Bash
What does appending a public key to authorized_keys do?