Introduction to SSH Known Hosts
When working with SSH, you’ve likely encountered the known hosts file, typically located at ~/.ssh/known_hosts. This file stores the public keys of hosts you’ve connected to, ensuring that when you reconnect, the host’s key matches the one stored, preventing man-in-the-middle attacks. I’ve seen this go wrong when the file gets out of date or corrupted - it’s a real hassle to deal with. Managing this file can become cumbersome, especially in environments with many hosts or when hosts’ keys change frequently.