What is a purpose of an SSH host key?
What is a purpose of an SSH host key?
An SSH host key provides the server's identity information to connecting SSH clients. This ensures that the client is connecting to the correct server and helps prevent man-in-the-middle attacks. The host key is presented to the client, which verifies it against a known list of host keys stored on the client machine to establish a secure connection.
Hosts Keys=> It provides the server's identity information to connecting SSH clients and are stored in the /etc/ssh directory of the server, basically they are the finger prints presented to the connecting party (client) to accept the identity of the host server and connection is established once the client accepts the presented finger-prints/host keys.
~/.ssh/authorized_keys: Holds a list of authorized public keys for servers. When the client connects to a server, the server authenticates the client by checking its signed public key stored within this file ~/.ssh/known_hosts: Contains DSA host keys of SSH servers accessed by the user. This file is very important for ensuring that the SSH client is connecting the correct SSH server.
I think the answer is D. The main purpose of using SSH key is that instead of using the password for every command employing SSH, we can use a key. To do so, in the client, you need to generate a pair of ssh keys for example id_rsa and id_rsa.pub and then we use ssh-copy-id to securely transfer the public key to the server and also to store this public key into a file named ~/.ssh/authorized_keys
But this question is asking for ssh hostkey, it's server identity and stored in ~/.ssh/known_hosts on client Correct answer is C
The correct answer is C. Ledlong is talking about ssh authentication keys.
Reference https://learning.lpi.org/en/learning-materials/102-500/110/110.3/110.3_01/
is this correct?
Yes, because the first time the system ask you to accept and store the server's public key. In order to avoid man in the middle attacks. This public key is different from user's public key, beware