add freebsd support, fix template

This commit is contained in:
nd 2019-06-25 22:24:46 +01:00
parent 0df06810fc
commit 6e5f0d0726
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
3 changed files with 5 additions and 9 deletions

View file

@ -19,7 +19,7 @@
path: "{{ rootpath }}/root/.ssh" path: "{{ rootpath }}/root/.ssh"
state: directory state: directory
owner: root owner: root
group: root group: "{{root_group}}"
mode: 0700 mode: 0700
- name: write authorized_keys file for user root - name: write authorized_keys file for user root
@ -27,7 +27,7 @@
src: ssh_root_authorized_keys.j2 src: ssh_root_authorized_keys.j2
dest: "{{ rootpath }}/root/.ssh/authorized_keys" dest: "{{ rootpath }}/root/.ssh/authorized_keys"
owner: root owner: root
group: root group: "{{root_group}}"
mode: 0600 mode: 0600
- name: create ssh host keys - name: create ssh host keys

View file

@ -32,13 +32,8 @@ AuthenticationMethods publickey
# LogLevel VERBOSE logs user's key fingerprint on login. Needed to have a clear audit track of which key was using to log in. # LogLevel VERBOSE logs user's key fingerprint on login. Needed to have a clear audit track of which key was using to log in.
LogLevel VERBOSE LogLevel VERBOSE
# Root login should not be allowed for auditing reasons. This is because it's difficult to track which process belongs to which root user: PermitRootLogin yes
# UseDNS no
# On Linux, user sessions are tracking using a kernel-side session id, however, this session id is not recorded by OpenSSH.
# Additionally, only tools such as systemd and auditd record the process session id.
# On other OSes, the user session id is not necessarily recorded at all kernel-side.
# Using regular users in combination with /bin/su or /usr/bin/sudo ensure a clear audit track.
PermitRootLogin yes # but we need it to login from dom0
# Use kernel sandbox mechanisms where possible in unprivilegied processes # Use kernel sandbox mechanisms where possible in unprivilegied processes
# Systrace on OpenBSD, Seccomp on Linux, seatbelt on MacOSX/Darwin, rlimit elsewhere. # Systrace on OpenBSD, Seccomp on Linux, seatbelt on MacOSX/Darwin, rlimit elsewhere.

1
vars/main.yml Normal file
View file

@ -0,0 +1 @@
root_group: "{% if ansible_os_family == 'FreeBSD' %}wheel{% else %}root{% endif %}"