diff --git a/roles/ssh_hardening/templates/opensshd.conf.j2 b/roles/ssh_hardening/templates/opensshd.conf.j2 index 4f2a9f508..9d05ca5e1 100644 --- a/roles/ssh_hardening/templates/opensshd.conf.j2 +++ b/roles/ssh_hardening/templates/opensshd.conf.j2 @@ -171,7 +171,7 @@ DenyUsers {{ ssh_deny_users }} {% endif %} {% if ssh_allow_users %} -AllowUsers {{ ssh_allow_users }} +AllowUsers {{ ssh_allow_users if (ssh_allow_users is string) else (ssh_allow_users|join(' ')) }} {% endif %} {% if ssh_deny_groups %}