0

My issue is that when I log onto my Ubuntu 19.04 server the SSH login displays the dynamic MOTD twice. I have followed the three following questions but these have not worked for me:

motd displayed twice

https://serverfault.com/questions/481146/there-are-two-motds-shown-when-i-login-to-my-server-using-ssh

https://stackoverflow.com/questions/190912/etc-motd-printing-twice-on-gentoo-linux

Here are the only mentions of pam_motd.so in /etc/pam.d/

>/etc/pam.d$ grep -ri "pam_motd.so" /etc/pam.d/

/etc/pam.d/sshd:session optional pam_motd.so motd=/run/motd.dynamic

/etc/pam.d/sshd:# session optional pam_motd.so noupdate

/etc/pam.d/login:# session optional pam_motd.so motd=/run/motd.dynamic

/etc/pam.d/login:# session optional pam_motd.so noupdate

So here we can see only one line is not commented out. When I comment out the one remaining line, the MOTD is not displayed at all, so the problem has been narrowed to the line in /etc/pam.d/sshd. I have also disabled the PrintMotd option in sshd_config, which has been an issue in the mentioned questions. I have also confirmed that the actual motd.dynamic file is correctly being generated.

Thank you for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.