Disable password authentication on sshd

To disallow password authentication on ssh, adduser –disabled-password will not disable openSSH password.

adduser –disabled-password

To disable the password authentication, you have to put these values on /etc/ssh/sshd_config to:

Then you’ve to:

to apply changes.

Connection will not be reset so before logout try to login on a different terminal to check you can login.

Actually PermitRootLogin disable the root login for any method, but it’s an useful addition. Remember to add at least one user to the sudo group or you will not be able to operate as super-user without using su – root.

To check if password auth is disabled:

Exprected output is:

https://web.archive.org/web/20190310000000*/https://explainshell.com/explain?cmd=adduser+--disabled-password

Proxied content from gemini://chirale.org/2019-03-10_4933.gmi (external content)

Gemini request details:

Original URL
gemini://chirale.org/2019-03-10_4933.gmi
Status code
Success
Meta
text/gemini; charset=utf-8
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.