How to display /etc/motd and /etc/motd.d/* when ssh login on RHEL9 ?
Issue
-
PrintMotdparameter in/etc/ssh/sshd_configis not effective on RHEL9. Even if it is set as defaultyes,/etc/motdand/etc/motd.d/*are not displayed when ssh login on one RHEL9 server.
(pam_motd.sois no set or commented out in/etc/pam.d/sshdat the same time.)[root@rhel9 ~]# grep -i motd /etc/ssh/sshd_config PrintMotd yes [root@rhel9 ~]# grep -i motd /etc/pam.d/sshd # session optional pam_motd.so [root@rhel9 ~]# ls -l /etc/motd* -rw-r--r--. 1 root root 15 Jan 23 13:13 /etc/motd /etc/motd.d: total 0 lrwxrwxrwx. 1 root root 22 Nov 13 20:59 cockpit -> ../../run/cockpit/motd lrwxrwxrwx. 1 root root 41 Nov 13 20:59 insights-client -> /etc/insights-client/insights-client.motd(On ssh client)
[root@test ~]# ssh rhel9 root@rhel9's password: Last login: Wed Mar 26 12:45:20 2025 from 192.168.X.XX [root@rhel9 ~]#
Environment
- Red Hat Enterprise Linux (RHEL) 9
- openssh
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.