From Newsgroup: alt.os.linux.ubuntu
Jonathan N. Little wrote:
I have just 2 servers that display the MOTD messages twice when either logging in or when ssh in. One is running 20.04 and the other 22.04, but
I have others servers that do not do this.
Also comparing confs for often posted "remedies" I have found in forums:
/etc/pam.d/login, /etc/pam.d/sshd, and /etc/ssh/sshd_config and my /etc/ssh/sshd_config.d/local.conf are identical for the servers that
double the MOTD to those that properly only display it once. PUZZLED
I was able to replicate the *default* motd behavior on the two wayward
servers by editing both the /etc/pam.d/login and /etc/pam.d/sshd by
commented out the noupdate option as so:
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
session optional pam_motd.so motd=/run/motd.dynamic
#session optional pam_motd.so noupdate
The MOTD does update with each login, but now just displays once.
However I am unable to determine why this is necessary, since the other
servers require no such edit. If anyone can enlighten it would be welcomed.
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
--- Synchronet 3.20a-Linux NewsLink 1.114