{"id":7808,"date":"2015-09-10T15:39:54","date_gmt":"2015-09-10T21:39:54","guid":{"rendered":"https:\/\/www.jumpcloud.com\/engineering-blog\/?p=353"},"modified":"2022-05-11T10:42:04","modified_gmt":"2022-05-11T14:42:04","slug":"managing-your-known-hosts-file","status":"publish","type":"post","link":"https:\/\/jumpcloud.com\/blog\/managing-your-known-hosts-file","title":{"rendered":"Managing your known hosts file"},"content":{"rendered":"\n
When you connect to a web site, you want to be assured that it\u2019s the correct one, and not a fake site pretending to be something it\u2019s not. Imagine if you attempted to go to Amazon but someone managed to intercept your traffic? You could end up providing them your credit card and personal information, and you\u2019d be in a bad spot.<\/p>\n\n\n\n
The same is true for connecting to your remote servers using SSH. When you establish a connection from your client you need to know you’re actually communicating with your server and not someone spoofing your server and capturing your sensitive data. This is known as a \u201cman-in-the-middle\u201d attack.<\/p>\n\n\n\n
A man-in-the-middle attack is one where a bad guy has managed to insert themselves into the communication chain between you and your server. Note that this isn\u2019t all that unreasonable \u2014 network traffic typically jumps through several relay points before reaching its destination. If someone malicious is at one of those points listening for interesting traffic, they can pretend to be your remote server and steal your confidential information. They can even act as you on the remote server after you\u2019ve established your identity to it!<\/p>\n\n\n\n
So how do we prevent these attacks? We need to have a secure mechanism for identifying the other server \u2014 sounds like a perfect job for public key authentication. Basically if SSH has the remote server\u2019s public key, it can establish identity by requesting that the remote server sign a chunk of data with the associated private key. This is exactly analogous to the ceremony used by the remote ssh server to establish the user\u2019s identity subsequently, as seen in this webinar.<\/a><\/p>\n\n\n\n