--- Begin Message ---
Package: libpam-modules
Version: 1.1.3-7.1
libpam-modules contains pam_motd, which should disaplay a motd and
update it dynamically.
The man page states, that there is an option noupdate to disable
updating the motd, otherwise it is updated. By default /etc/pam.d/sshd
contains lines like
session optional pam_motd.so motd=/run/motd.dynamic noupdate
session optional pam_motd.so
The last entry makes pam_motd.so show /etc/motd - and makes it also
update a third motd file (that is not mentioned anywhere except in the
source code): /var/run/motd
The latter path is hardcoded here:
http://patch-tracker.debian.org/patch/series/view/pam/1.1.1-6.1+squeeze1/update-motd
Also /run/motd.dynamic is updated by a init.d script, that only writes
the output of uname into it, ignoring scripts in /etc/update-motd.d,
that are used by pam_motd.so to update /var/run/motd.
This is not a clean design and badly documented. Therefore I propose the
following changes:
1) Make the motd init script use /etc/update-motd.d and the uname
command to a script there
2) Fix pam_motd.so to update the motd file given in the motd option
instead of always /var/run/motd
3) Change the sshd pam config to:
session optional pam_motd.so motd=/run/motd.dynamic
session optional pam_motd.so noupdate
-> This will first show the dynamic motd and update it if required. Then
it will show /etc/motd, that can contain static contents.
--- End Message ---
--- Begin Message ---
- To: 821735-done@bugs.debian.org
- Subject: Re: Bug#743286: dynamic motd inconsistencies
- From: Colin Watson <cjwatson@debian.org>
- Date: Thu, 4 Dec 2025 14:56:34 +0000
- Message-id: <aTGhIhR9YMrF6hPE@riva.ucam.org>
- In-reply-to: <20140401112342.GB4294@genius.invalid>
- References: <20140401112342.GB4294@genius.invalid>
Source: openssh
Source-Version: 1:6.6p1-7
Regarding the OpenSSH side of this bug:
On Tue, Apr 01, 2014 at 01:23:42PM +0200, Till Maas wrote:
The man page states, that there is an option noupdate to disable
updating the motd, otherwise it is updated. By default /etc/pam.d/sshd
contains lines like
session optional pam_motd.so motd=/run/motd.dynamic noupdate
session optional pam_motd.so
[...]
3) Change the sshd pam config to:
session optional pam_motd.so motd=/run/motd.dynamic
session optional pam_motd.so noupdate
-> This will first show the dynamic motd and update it if required. Then
it will show /etc/motd, that can contain static contents.
This seems to have been covered by https://bugs.debian.org/757059, and
as such was fixed in version 1:6.6p1-7, which was part of Debian 8
(jessie). Sorry for taking so long to remember to close this bug as
well.
--
Colin Watson (he/him) [cjwatson@debian.org]
--- End Message ---