Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just verified this is also the case with at least some AWS-hosted servers. Coupled with the fact that many people simply ignore the MITM warning that SSH throws, this is scary stuff.


The official ubuntu AMIs generate a new key pair on first boot. The AMIs provided by Amazon do the same.

If you're using AMIs from some other third party you should verify that they do the right thing.


Curious. I just upgraded a small server to a medium, detaching the existing volume and reattaching it to the new instance, and it has given me a new fingerprint.


unfortunately, devops (like me) need to ignore these as part of our work system.

i need to automate deployment / reprovisioning of 30 digital ocean servers. as reprovisionined servers frequently use the same ip address, i always run into this. for me I had to disable the check :(


Part of automating deployment is automating key management. Ignoring host key checks is the worst possible solution.

You're actually better off just baking a shared key into your image. So long as it's a key you generated yourself (not like this Digital Ocean scenario, where the key came from the cloud host), only someone who has already rooted one server can successfully MITM your SSH connections.

Whereas if you ignore host key checks entirely, anyone who gains control of one network hop between you and your servers can own you.


By disabling that check, you are destroying a huge component of the security that SSH provides. Perhaps you could clean up the authorized_keys file as part of your teardown script?


I've ended up in this situation too. We migrate between datacenters with duplicate hosts fairly frequently at my primary place of employment, and best practice is to use the cname of the service to access the server currently acting as the primary for it (e.g. foo.bar.com as opposed to foo.datacenter.bar.com). That leaves me with a lot of foo.bar.com entries to clean out of known_hosts, or a lot of spurious MITM errors.

What I've done is added a whitelist to my .ssh/config to disable the alerts only for those hosts. The foo.datacenter.bar.com address (which I use often enough, usually when migrating it between datacenters) still alerts.

And yes, I know I'm living in the 90s what with my datacenters and whatnot. They're kind of like regions... what? Oh... why, you... You kids, get off my lawn!


Not managing keys is asking for trouble. Consider signing your SSH keys to validate that you've properly pruned outdated host entries.

See:

http://www.openbsd.org/papers/asiabsdcon2011_openssh_whats_n...

http://blog.habets.pp.se/2011/07/OpenSSH-certificates

http://en.community.dell.com/techcenter/b/techcenter/archive...

Spend an afternooon to figure this out.


I ran into this issue as well. As the person below mentioned, make this part of your teardown script. You can use ssh-keygen -R hostname to remove host from ~/.ssh/known_hosts.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: