change backup user name

This commit is contained in:
Pim Kunis 2023-04-11 17:41:11 +02:00
parent 82ce487559
commit c9baaa2205
3 changed files with 8 additions and 6 deletions

View file

@ -94,22 +94,22 @@
notify: enable interfaces
- name: Add backup user
user:
name: lewis
name: "{{ backup_share_user }}"
create_home: false
password: '!'
shell: /sbin/nologin
system: true
- name: Add backup user principals file
copy:
dest: "/etc/ssh/lewis_principals"
dest: "/etc/ssh/backup_principals"
content: "backup"
- name: Install user CA
copy:
dest: "/etc/ssh/user_ca_key.pub"
content: "{{ user_ca }}"
- name: Copy ssh config for backup user
copy:
src: "sshd.conf"
template:
src: "sshd.conf.j2"
dest: "/etc/ssh/sshd_config.d/custom.conf"
notify: restart sshd
roles:

View file

@ -1,3 +1,5 @@
backup_share_user: "backup-share"
backup_control_user: "backup-control"
user_ca: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGKOClnK6/Hj8INjEgULY/lD2FM/nbiJHqaSXtEw4+Fj User Certificate Authority for DMZ"
storage_pools: [iso, disk, init]
wireguard_addresses:

View file

@ -1,7 +1,7 @@
TrustedUserCAKeys /etc/ssh/user_ca_key.pub
Match User lewis
AuthorizedPrincipalsFile /etc/ssh/lewis_principals
Match User {{ backup_share_user }}
AuthorizedPrincipalsFile /etc/ssh/backup_principals
ChrootDirectory /kvm/data
ForceCommand internal-sftp
AllowTcpForwarding no