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 notify: enable interfaces
- name: Add backup user - name: Add backup user
user: user:
name: lewis name: "{{ backup_share_user }}"
create_home: false create_home: false
password: '!' password: '!'
shell: /sbin/nologin shell: /sbin/nologin
system: true system: true
- name: Add backup user principals file - name: Add backup user principals file
copy: copy:
dest: "/etc/ssh/lewis_principals" dest: "/etc/ssh/backup_principals"
content: "backup" content: "backup"
- name: Install user CA - name: Install user CA
copy: copy:
dest: "/etc/ssh/user_ca_key.pub" dest: "/etc/ssh/user_ca_key.pub"
content: "{{ user_ca }}" content: "{{ user_ca }}"
- name: Copy ssh config for backup user - name: Copy ssh config for backup user
copy: template:
src: "sshd.conf" src: "sshd.conf.j2"
dest: "/etc/ssh/sshd_config.d/custom.conf" dest: "/etc/ssh/sshd_config.d/custom.conf"
notify: restart sshd notify: restart sshd
roles: 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" user_ca: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGKOClnK6/Hj8INjEgULY/lD2FM/nbiJHqaSXtEw4+Fj User Certificate Authority for DMZ"
storage_pools: [iso, disk, init] storage_pools: [iso, disk, init]
wireguard_addresses: wireguard_addresses:

View file

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