As of today(16th August 2024), you need to do a little bit more than that to allow password authentication in the sshd_config
file.
In the sshd_config
file, there is this import file:
Include /etc/ssh/sshd_config.d/*.conf
If you follow that import into the sshd_config.d
directory, you find a file named 60-cloudimg-setttings.conf
in which you will find the following:
PasswordAuthentication no
All you have to do is change the no to yes.
PasswordAuthentication yes
It seems GCP or whoever added that Include really didn't want people SSHing into the VMs with passwords and made an extra effort to make sure it is not easy to do so. (Took me almost an entire day trying to figure why it was never working simply by changing the sshd_config
file's PasswordAuthentication no
to PasswordAuthentication yes
.
sshd
on your cloud instance is configured to prohibit password authentication. – Porpoise