nerdexam
CompTIA

XK0-005 · Question #10070

A junior Linux administrator needs to access production servers using a secure SSH protocol. Which of the following files should contain the public key to gain remote access to the server?

The correct answer is D. ~/.ssh/authorized_keys. The public key for SSH authentication is stored in the authorized_keys file within the user's hidden .ssh directory in their home directory.

Security

Question

A junior Linux administrator needs to access production servers using a secure SSH protocol. Which of the following files should contain the public key to gain remote access to the server?

Options

  • A~/ssh/authorized-keys
  • B/etc/authorized_keys
  • C/etc/sshd/ssh.conf
  • D~/.ssh/authorized_keys

How the community answered

(47 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    6% (3)
  • D
    89% (42)

Why each option

The public key for SSH authentication is stored in the `authorized_keys` file within the user's hidden `.ssh` directory in their home directory.

A~/ssh/authorized-keys

This path uses a hyphen instead of an underscore for `authorized-keys` and is not the standard location.

B/etc/authorized_keys

/etc/authorized_keys is not the standard or correct location for user-specific SSH public keys; /etc is for system-wide configuration.

C/etc/sshd/ssh.conf

/etc/sshd/ssh.conf is not a standard path for SSH configuration and public keys are not stored in a configuration file like this, but in `authorized_keys`.

D~/.ssh/authorized_keysCorrect

For secure SSH key-based authentication, the public key of the client is placed in the `~/.ssh/authorized_keys` file on the server. The `~` symbol represents the user's home directory, and `.ssh` is a hidden directory specifically for SSH configuration and keys. When an SSH client attempts to connect, the server checks the public key provided by the client against the keys listed in this file.

Concept tested: SSH public key authentication file location

Source: https://man7.org/linux/man-pages/man8/sshd.8.html

Topics

#SSH#Public Key Authentication#Remote Access#File Paths

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice