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?
Click on the arrows to vote for the correct answer
A. B. C. D.D.
https://www.linode.com/docs/security/securing-your-server/The file that should contain the public key to gain remote access to a Linux server using SSH is the ~/.ssh/authorized_keys
file. This file is located in the user's home directory, and it contains a list of public keys that are authorized to access the server using SSH.
Here's a more detailed explanation of each of the options:
A. ~/ssh/authorized-keys
: This is not a valid path for an authorized keys file. The correct directory is ~/.ssh/
.
B. /etc/authorized_keys
: This is also not a valid path for an authorized keys file. The correct path is ~/.ssh/authorized_keys
, which is located in the user's home directory.
C. /etc/sshd/ssh.conf
: This file does not contain authorized keys. Instead, it is the main configuration file for the SSH server, and it contains settings for the server's behavior and security.
D. ~/.ssh/authorized_keys
: This is the correct file and location for authorized keys. The ~
symbol represents the user's home directory, and the .
before ssh
indicates that it is a hidden directory. The authorized_keys
file should contain a list of public keys, one per line, that are authorized to access the server using SSH.
Therefore, the correct answer is D. ~/.ssh/authorized_keys
.