Skip to main content

SSH PAssword Authentication

· One min read

TL;DR

  • Check the files
    • /etc/ssh/sshd_config.d/50-cloud-init.conf
    • /etc/ssh/sshd_config
  • Change the setting PasswordAuthentication
  • Check the setting sudo sshd -T

It used to be that modifying the file /etc/ssh/sshd_config is all it takes to enable/disable password authentication.

PasswordAuthentication no
# PasswordAuthentication yes

For some reason, in modern systems, this is overridden by another init file: /etc/ssh/sshd_config.d/50-cloud-init.conf

Testing this is tedious - having to use another computer and running the command. Especially when you're not sure if it's due to the setting not enabled or if you typed the wrong password.

Turns out, there is a way to check it on the server where the SSH daemon is run:

sudo sshd -T | grep -i password