Skip to content

Commit

Permalink
Merge pull request #831 from bshephar/sshd-motd
Browse files Browse the repository at this point in the history
Use PAM for sshd Motd
  • Loading branch information
openshift-merge-bot[bot] authored Dec 3, 2024
2 parents bee8d8c + e032cf2 commit 1c2675c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions roles/edpm_sshd/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@
{% if edpm_sshd_banner_enabled %}
{% set _ = edpm_sshd_server_options.__setitem__('Banner', '/etc/issue') %}
{% endif %}
{% if edpm_sshd_motd_enabled %}
{% set _ = edpm_sshd_server_options.__setitem__('PrintMotd', 'yes') %}
{% endif %}
{{ edpm_sshd_server_options }}
- name: Set sshd motd when enabled
ansible.builtin.lineinfile:
path: /etc/pam.d/sshd
regexp: "^session.*optional.*pam_motd.so"
line: "session optional pam_motd.so motd=/etc/motd"
state: present
when: edpm_sshd_motd_enabled

- name: Adjust ssh server configuration
become: true
ansible.builtin.template:
Expand Down

0 comments on commit 1c2675c

Please sign in to comment.