Where does OpenSSH keep track of previously connected hosts and their public keys?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

OpenSSH creates a file named "known_hosts" to store the public keys of previously connected hosts. This is crucial for securing SSH connections because it enables the client to verify the identity of the server it is connecting to, helping to prevent man-in-the-middle attacks.

When a user first connects to a new host via SSH, the server's public key is presented and, if accepted, it is saved in the "known_hosts" file located in the user's .ssh directory. This local storage of keys allows OpenSSH to prompt the user if the host key changes in future connections, which can be an indication of a potential security issue.

The other choices do not correctly represent where OpenSSH stores its known hosts. "/etc/hosts" is typically used for hostname resolution, while "/var/log/ssh_connectivity.log" is not a standard file used by OpenSSH for this purpose. Lastly, "~/.ssh/hosts" is not a recognized file in OpenSSH’s architecture. Thus, the "known_hosts" file serves as the proper repository for managing the trusted public keys of hosts the user has connected to in the past.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy