By asterixzzz
Anyone who has an opinion on which method is the best to protect SSH, keypairs or the two factor authentication below?
https://www.digitalocean.com/community/articles/how-to-protect-ssh-with-two-factor-authentication
To protecting houses we first had private keys and public keyholes. Then door codes. Then access cards combined with a code. I mean when I lose my key I also lose access to my server and someone else might get access instead. Even if I protect my private key with a password it’s easy to hack on someone’s computer if it gets lost. If I store a password on a server It’s not so easy to hack it if I have fail2ban and port knocking.
Keys always need to be stored somewhere, unencrypted discs, smartphones, dropbox etc. An easy-to-remember 18+ character password only need to be stored in a non-hackable brain. And combined with two factor authentication it seems to me safer then using key pairs.
If I use the Google Authenticator app in my phone I can still lose my phone/sim card. But if I also enable two-factor for a second phone I can always store that sim card in a safe place to always have access to my server, just in case I lose my phone. And if anyone get access to my phone they still need to know the ssh password.
Anyone who has an opinion on this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
We have both, normally we use keys and in case that it’s an emergency or the like, we can log in with 2FA. <br> <br>Additionally we have fail2ban and synchronize our block list over all our servers with badips.com. <br> <br>
@sim thanks for the info on badips.com. Hopefully this’ll reduce the number of fail2ban emails I get on a daily basis.
2FA Works Great, make sure you backup your private keys in a safe place though incase you loose or break your phone. <br> <br>2factor is great because your phone can be offline and only you can access it if you have that phone or super long pin. <br> <br>What I dont like about keys is that they have to be stored on a computer and are hard to backup if you loose them. <br> <br>Johnathan Martin <br>fitbobcat.com
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.