1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_sshd.git synced 2024-08-16 11:59:49 +02:00

Optionally disable Allow[Users,Groups] options

This commit is contained in:
Raoul 2018-08-26 17:25:12 +02:00
parent f03546d93c
commit 6799a8ce25
No known key found for this signature in database
GPG key ID: C7493D73B67C1842
3 changed files with 7 additions and 0 deletions

3
defaults/main.yml Normal file
View file

@ -0,0 +1,3 @@
---
# Enable AllowUsers and AllowGroups options
restrict_allow_users: True

View file

@ -7,6 +7,8 @@ Ansible role to configure the OpenSSH `ssh` server.
Variables Variables
--------- ---------
* `restrict_allow_users`: enable the `AllowUsers` and `AllowGroups` options.
Files Files
----- -----

View file

@ -32,8 +32,10 @@ UsePAM yes
# User Authentication # User Authentication
{% if restrict_allow_users|default(True) %}
AllowUsers {{ sshd_allow_users|join(' ') }} AllowUsers {{ sshd_allow_users|join(' ') }}
AllowGroups {{ sshd_allow_groups|join(' ') }} AllowGroups {{ sshd_allow_groups|join(' ') }}
{% endif %}
PermitRootLogin without-password PermitRootLogin without-password
LoginGraceTime 120 LoginGraceTime 120