-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PAM for sshd Motd #831
Use PAM for sshd Motd #831
Conversation
This change switches the method we use to display the motd. Previously, we used PrintMotd in the sshd config. RHEL9 configures pam_motd.so in PAM, and as such the motd will be duplicated when using PrintMotd. To avoid this, we can configure the motd via PAM. Related: https://bugzilla.redhat.com/show_bug.cgi?id=2329414 Signed-off-by: Brendan Shephard <[email protected]>
recheck |
ansible.builtin.lineinfile: | ||
path: /etc/pam.d/sshd | ||
regexp: "^session.*optional.*pam_motd.so" | ||
line: "session optional pam_motd.so motd=/etc/motd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, i already have the line in this file in my RHEL 9.2 edpm node, but without the motd=/etc/motd
, that is the default, so that part is likely not needed. But, I'm fine either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, so the issue this solves is that PrintMotd
defaults to yes
in sshd_config
. So if we don't explicitly set it to no
then the motd is duplicated.
Explicitly telling pam the exact file to use results in the single message being printed instead of the duplication. But, I did some more digging to make sure I was answering the questions on the BZ accurately, and I actually think that this might be a better solution to the problem:
#838
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bshephar, slagle The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
recheck |
/override rdoproject.org/github-check |
@slagle: Overrode contexts on behalf of slagle: rdoproject.org/github-check In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
1c2675c
into
openstack-k8s-operators:main
This change switches the method we use to display the motd. Previously, we used PrintMotd in the sshd config. RHEL9 configures mod_motd.so in PAM, and as such the motd will be duplicated when using PrintMotd. To avoid this, we can configure the motd via PAM.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2329414