nerdexam
CompTIA

XK0-005 · Question #831

A systems administrator wants to leverage their password-protected SSH key to connect to multiple servers without entering their password every time. Which of the following commands should the…

The correct answer is C. ssh-add. To avoid repeatedly entering the passphrase for a password-protected SSH key, the ssh-add command adds the key to the ssh-agent, which then manages the key for subsequent SSH connections.

System Management

Question

A systems administrator wants to leverage their password-protected SSH key to connect to multiple servers without entering their password every time. Which of the following commands should the administrator use?

Options

  • Assh-copy-id
  • Bssh-agent
  • Cssh-add
  • Dssh-keygen

How the community answered

(61 responses)
  • A
    11% (7)
  • B
    3% (2)
  • C
    80% (49)
  • D
    5% (3)

Why each option

To avoid repeatedly entering the passphrase for a password-protected SSH key, the ssh-add command adds the key to the ssh-agent, which then manages the key for subsequent SSH connections.

Assh-copy-id

ssh-copy-id is used to copy a public SSH key to a remote server's authorized_keys file, enabling passwordless login to that server, but it does not manage the passphrase for a local private key.

Bssh-agent

ssh-agent is the background program that holds the private keys and performs authentication, but ssh-add is the command used to load keys into the agent, not ssh-agent itself.

Cssh-addCorrect

The ssh-add command adds private key identities to the authentication agent (ssh-agent). When a password-protected SSH key is added to the ssh-agent using ssh-add, the passphrase only needs to be entered once, and the agent handles subsequent authentication requests.

Dssh-keygen

ssh-keygen is used to generate new SSH key pairs (public and private keys), not to manage existing keys with an agent.

Concept tested: SSH key management with ssh-agent

Source: https://man7.org/linux/manpages/man1/ssh-add.1.html

Topics

#SSH#Key Management#ssh-agent#Authentication

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice