ansible/roles/ssh_totp/tasks/main.yml

26 lines
658 B
YAML
Raw Permalink Normal View History

2021-04-15 16:03:35 +02:00
---
- name: Eddit pam config for ssh
lineinfile:
path: /etc/pam.d/sshd
regexp: 'pam_oath.so'
2021-04-15 17:10:35 +02:00
line: "auth required pam_oath.so usersfile=/etc/users.oath window={{totp_periode}} digits={{totp_digits}}"
insertafter: "^# PAM configuration for the Secure Shell service"
2021-04-15 16:03:35 +02:00
- name: Set ChallengeResponseAuthentication in sshd conf
2021-04-15 16:24:51 +02:00
lineinfile:
2021-04-15 16:03:35 +02:00
path: /etc/ssh/sshd_config
regexp: '^#?ChallengeResponseAuthentication'
line: 'ChallengeResponseAuthentication yes'
2021-04-15 16:28:28 +02:00
notify: Reload sshd
2021-04-15 16:03:35 +02:00
- name: Set UsePAM in sshd conf
2021-04-15 16:24:51 +02:00
lineinfile:
2021-04-15 16:03:35 +02:00
path: /etc/ssh/sshd_config
regexp: '^#?UsePAM'
line: 'UsePAM yes'
2021-04-15 16:28:28 +02:00
notify: Reload sshd
2021-04-15 16:03:35 +02:00