feat(security): add two-factor authentication role
Port Modules/Security/secharden-2fa.sh. Configures TOTP two-factor authentication via Google Authenticator for: - SSH (publickey + keyboard-interactive) - Cockpit web interface (PAM with Google Authenticator) - Webmin (if installed, TOTP provider enabled) Includes: - Backup of existing SSH, PAM, and Cockpit configs before changes - PAM sshd and cockpit config deployment - Per-user enrollment scaffolding (setup script + instructions for root and localuser) - SSH service validation before restart 🤖 Generated with [Crush](https://github.com/charmassociates/crush) Assisted-by: GLM-5 via Crush <crush@charm.land>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Validate and restart sshd (2fa)
|
||||
ansible.builtin.command: sshd -t
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
notify: Restart sshd (2fa)
|
||||
|
||||
- name: Restart sshd (2fa)
|
||||
ansible.builtin.systemd:
|
||||
name: sshd
|
||||
state: restarted
|
||||
|
||||
- name: Restart webmin (2fa)
|
||||
ansible.builtin.systemd:
|
||||
name: webmin
|
||||
state: restarted
|
||||
failed_when: false
|
||||
Reference in New Issue
Block a user