add ssh authorized keys command

This commit is contained in:
2026-01-26 00:07:45 -07:00
parent 118ee411c7
commit b5d9f37bb7
3 changed files with 19 additions and 0 deletions

View File

@@ -3,3 +3,7 @@
name: sssd name: sssd
state: restarted state: restarted
- name: restart sshd
service:
name: sshd
state: restarted

View File

@@ -1,3 +1,4 @@
- import_tasks: install.yaml - import_tasks: install.yaml
- import_tasks: authselect.yaml - import_tasks: authselect.yaml
- import_tasks: nsswitch.yaml - import_tasks: nsswitch.yaml
- import_tasks: sshd.yaml

View File

@@ -0,0 +1,14 @@
- name: Ensure sshd has AuthorizedKeysCommand
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^AuthorizedKeysCommand'
line: 'AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys'
notify: restart sshd
- name: Ensure sshd has AuthorizedKeysCommandUser
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^AuthorizedKeysCommandUser'
line: 'AuthorizedKeysCommandUser nobody'
notify: restart sshd