diff --git a/README.md b/README.md index 5403255..29582d5 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ users: - ottojo@uni - ottojo@home ``` +*have a look into defaults/main.yml foraditionally informations!* Files ----- diff --git a/defaults/main.yml b/defaults/main.yml index 5c7f89b..4cb9287 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,8 @@ --- +# default users for SSH access +sshd_default_allowed_users: + - "root" + - "ansible" + # Enable AllowUsers and AllowGroups options restrict_allow_users: True diff --git a/tasks/main.yml b/tasks/main.yml index 43f2f0b..97b2fc1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,7 +15,7 @@ - name: Collect all users and groups allowed to login via ssh set_fact: - sshd_allow_users: '{{ ["root", "ansible"] + users.keys() | default({}) | sort }}' + sshd_allow_users: '{{ sshd_default_allowed_users + users.keys() | default({}) | sort }}' sshd_allow_groups: '{{ ["root", "admins"] + users.keys() | default({}) | sort }}'