Bug 1226268 - ssh login motd duplicates
Summary: ssh login motd duplicates
Status: NEW
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Network (show other bugs)
Version: Leap 15.6
Hardware: x86-64 Other
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Antonio Larrosa
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-12 21:57 UTC by Le
Modified: 2024-07-19 10:19 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Le 2024-06-12 21:57:43 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
Comment 1 Felix Niederwanger 2024-06-27 07:40:58 UTC
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.
Comment 2 Antonio Larrosa 2024-07-19 10:19:51 UTC
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)