ansible-sshd/examples/example-use-certificates.yml
EmyLIEUTAUD 0bc6d8f40b
feat: manage ssh certificates (#252)
* Role configured to accept SSH connection via SSH certificates
* Works with or without principals and ansible-lint updated
* add test for SSH certificates authentication with principals
* Add configuration to run tests for SSH certificates authentication with principals
* tasks to use SSH certificates grouped into one file
* Update README.md
2023-09-11 14:39:03 +01:00

23 lines
910 B
YAML

---
- name: Use SSH certificates
hosts: all
tasks:
- name: Configure sshd to enable SSH Certificate login
ansible.builtin.include_role:
name: ansible-sshd
vars:
sshd:
# Disable password authentication, use SSH Certificates and configure authorized principals
PasswordAuthentication: false
TrustedUserCAKeys: /etc/ssh/trusted-user-ca-keys.pub
AuthorizedPrincipalsFile: "/etc/ssh/auth_principals/%u"
# List of trusted user CA keys
sshd_trusted_user_ca_keys_list:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICwqRjI9gAwkQF9iIylhRVAOFy2Joodh3fXJ7CbGWqUd
# Key is the user in the os, values are *Principals* defined in the certificate
sshd_principals:
admin:
- frontend-admin
- backend-admin
somelinuxuser:
- some-principal-defined-in-certificate