nerdexam
CompTIA

XK0-005 · Question #234

When requesting SSH access to a remote system, a user accidentally emailed the id_rsa key to the administrator. Which of the following should the user do NEXT?

The correct answer is D. Stop using that key and run ssh-keygen to generate a new key pair. Accidentally sharing a private SSH key compromises its security, requiring the user to immediately generate a new key pair to maintain system security.

Security

Question

When requesting SSH access to a remote system, a user accidentally emailed the id_rsa key to the administrator. Which of the following should the user do NEXT?

Options

  • ARun the ssh-add command to add the remote system to known_hosts.
  • BAsk the administrator to run chmod 600 id_rsa on the remote system.
  • CDelete id_rsa key file and send the id_rsa.pub key file instead.
  • DStop using that key and run ssh-keygen to generate a new key pair.

How the community answered

(41 responses)
  • A
    2% (1)
  • B
    5% (2)
  • C
    10% (4)
  • D
    83% (34)

Why each option

Accidentally sharing a private SSH key compromises its security, requiring the user to immediately generate a new key pair to maintain system security.

ARun the ssh-add command to add the remote system to known_hosts.

`ssh-add` manages keys in the SSH agent, and `known_hosts` stores public keys of remote servers; neither addresses the security compromise of a private key being exposed.

BAsk the administrator to run chmod 600 id_rsa on the remote system.

Setting `chmod 600 id_rsa` ensures proper local permissions but does not mitigate the fact that the private key was already transmitted insecurely and is potentially compromised.

CDelete id_rsa key file and send the id_rsa.pub key file instead.

Deleting the compromised private `id_rsa` key is part of the solution, but sending the *old* `id_rsa.pub` key is meaningless if the private key is compromised, and the immediate priority is to generate a new, secure key pair.

DStop using that key and run ssh-keygen to generate a new key pair.Correct

The `id_rsa` key is the private SSH key and must remain confidential. If it was accidentally emailed, it is compromised, and the user must immediately stop using it, revoke its access where possible, and generate a new SSH key pair with `ssh-keygen` to restore security.

Concept tested: SSH private key compromise handling

Source: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-managing_keys#sec-Generating_and_Distributing_a_New_SSH_Key_Pair

Topics

#SSH#Key management#Security best practices#Private key compromise

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice