SSH server's default configuration is to allow both password and public key logins.
Specifies whether password authentication is allowed. The default is yes.
Some admins consider password login to be insecure due to improper password management by the users. As such, you might want to disable password authentication on your SSH servers and force users to authenticate using other methods such as the public key.
You can enable or disable password authentication by configuring PasswordAuthentication directive in your SSH server.
$ sudo vi /etc/ssh/sshd_config [sudo] password for user:
Add the line if it doesn't already exist and remove # at the beginning of the line if it exists.
Set it to yes to allow password authentication method and no to disallow.
Make sure another authentication method is enabled and tested before disabling the password authentication method.
$ sudo systemctl restart sshd
|Red Hat Enterprise Linux|
|SUSE Linux Enterprise Server|
Comment anonymously. Login not required.