diff --git a/defaults/main.yml b/defaults/main.yml index e4ef4ee..8dbe253 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,3 +12,7 @@ sshd_default_allowed_groups: # Enable AllowUsers and AllowGroups options restrict_allow_users: True + +# Allow login with password? +sshd_password_authentication: no + diff --git a/templates/sshd_config b/templates/sshd_config index d8315f2..fff9ca5 100644 --- a/templates/sshd_config +++ b/templates/sshd_config @@ -21,7 +21,7 @@ HostKey /etc/ssh/ssh_host_ed25519_key # HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-ed25519 # Client authentication -PasswordAuthentication no +PasswordAuthentication {{ sshd_password_authentication }} ChallengeResponseAuthentication no PubkeyAuthentication yes