Disable password authentication for `SSH` daemon.

This commit is contained in:
Kazuhiro MUSASHI 2024-06-10 11:48:35 +09:00
parent 6bc876df6f
commit cf28ca20b6
1 changed files with 10 additions and 0 deletions

View File

@ -31,3 +31,13 @@ remote_file '/home/kazu634/.ssh/config' do
mode '644' mode '644'
end end
# Disable Password authentication
file '/etc/ssh/sshd_config.d/50-cloud-init.conf' do
action :delete
end
execute 'systemctl restart ssh.service ' do
action :nothing
subscribes :run, 'file[/etc/ssh/sshd_config.d/50-cloud-init.conf]'
end