Answers:
要回答所有MOTD消息从何而来,请首先查看PAM配置。
% grep -C1 motd /etc/pam.d/*
/etc/pam.d/sshd:session optional pam_motd.so motd=/run/motd.dynamic
看一下pam_motd.so运行的是什么。
% strings /lib/x86_64-linux-gnu/security/pam_motd.so
run-parts /etc/update-motd.d > /run/motd.dynamic.new
'run-parts'在目录中依次运行所有脚本。
% ls /etc/update-motd.d/
00-header* 80-esm* 91-release-upgrade* 98-reboot-required*
10-help-text* 80-livepatch* 95-hwe-eol*
50-motd-news* 90-updates-available* 98-fsck-at-reboot*
帮助程序脚本位于/ usr / lib / update-notifier / update-motd *中
/usr/lib/update-notifier/update-motd-fsck-at-reboot*
/usr/lib/update-notifier/update-motd-hwe-eol*
/usr/lib/update-notifier/update-motd-reboot-required*
/usr/lib/update-notifier/update-motd-updates-available*
数据文件在/ var / lib / update-notifier中
dpkg-run-stamp hwe-eol updates-available
fsck-at-reboot package-data-downloads/ user.d/
要从命令行输出MOTD信息,可以
$ ssh localhost
要么
# run-parts /etc/update-motd.d