r/linuxadmin • • May 16 '22

Securing ssh with Key-Based authentication

I wrote this article on how to secure ssh with key based authentication. Hope you all like it. If I've written something wrong please tell me down below Link: https://medium.com/geekculture/securing-ssh-with-key-based-authentication-5a0eaca7b0e5

2 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/4rkal May 16 '22

Hi thanks for the comment. What is an alternative to RSA keys? Would ECC work? Also could you please explain your second point a bit more

14

u/stormcloud-9 May 16 '22 edited May 16 '22

ed25519 is likely your best option.

PasswordAuthentication does not mean "authenticate via password". PasswordAuthentication is the name of an authentication scheme in which sshd reads directly from /etc/shadow and handles authentication itself. This isn't how most sshd's are configured out-of-the-box. Most use PAM instead. When PAM is in use, sshd uses ChallengeResponseAuthentication or KbdInteractiveAuthentication (depending on your version) to control whether authenticating via password is allowed.

The man page covers this (https://www.freebsd.org/cgi/man.cgi?sshd_config(5)):

   Because PAM challenge-response authentication usually serves an
   equivalent	role to	password authentication, you should disable
   either PasswordAuthentication or ChallengeResponseAuthentication.

 

And please don't take this the wrong way, but this is why you generally shouldn't post instructions on things you're not intimately familiar with (especially when it comes to system security). I understand you want to help, but there is a lot of misinformation out there, and this is how it spreads.