Bugzilla – Bug 1226268
ssh login motd duplicates
Last modified: 2024-07-19 10:19:51 UTC
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0 Build Identifier: After ssh login, the motd will appear twice. Reproducible: Always Steps to Reproduce: 1. ssh log into machine Actual Results: <MOTD> Last login: DATE from IP <MOTD> Expected Results: Last login: DATE from IP <MOTD> this after doing an online upgrade from opensuse leap 15.5 to 15.6
I observe the same issue on multiple Leap 15.6 instances, however only on the ones I upgraded from Leap 15.5. I cannot reproduce the issue on a fresh Leap 15.6 installation.
That's interesting. The default value when PrintMotd doesn't appear in /etc/ssh/sshd_config is "yes". In 15.6, the motd is now printed by pam_motd, so we changed the sshd_config file installed by the openssh-server package to have "PrintMotd no" but if the /etc/ssh/sshd_config file was modified in some way then rpm will not replace it during the system upgrade and will leave the old configuration file that doesn't set PrintMotd. In fact, I tested installing a 15.5 vm and then upgrading it to 15.6 and I couldn't reproduce the issue, but then, I didn't modify the sshd_config file, so it could be replaced with the new version during the upgrade. Can you please check if you have a sshd_config.rpmnew file under /etc/ssh/sshd_config? The best would be to merge the new changes from that file but in any case, you can also try just adding a line with "PrintMotd no" into sshd_config. That should leave just one motd. Also, if you want to remove the motd so it's not shown at all, in 15.6 the way to do it is to remove the contents of /etc/motd and leave it empty. Just for the record, in TW this is now done by creating a symlink like this: "ln -s /dev/null /etc/motd.d/welcome" which silences /usr/lib/motd.d/welcome (which is where the motd is set now)