Passwordログイン無効化で躓いた話

概要

/etc/ssh/sshd_configを修正してもパスワード変更ができてしまった事象があり、そのときの対処法について記載

作業内容

始め下記のような変更を行っていましたがなぜがパスワードログインができてしまっていました。

/etc/ssh/sshd_config

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
PasswordAuthentication no

調べていたら、/etc/ssh/sshd_config.d/50-cloud-init.confも変更しないといけないらしいです。

/etc/ssh/sshd_config.d/50-cloud-init.conf

#PasswordAuthentication yes
PasswordAuthentication no

参考文献

PasswordAuthenticationで躓いたお話

以上