motd
MOTD (Message of the day)
- static
/etc/motd
- Then, Ubuntu Intrepid Ibex (2008) introduced a package update-motd, which consisted of
- a script called update-motd.
- an entry in /etc/cron.d calling update-motd every 10 minutes.
- a folder /etc/update-motd.d
- The script runs all the scripts in /etc/update-motd.d using run-parts, then stores all output in /var/run/motd.
- For this reason, even in Debian if we create the folder /etc/update-motd.d, which does not exist by default, it will be run at every login in the same way as if we had Ubuntu’s update-motd package installed.
files
-
/etc/motd
– The classic, static file. Does not exist anymore in Ubuntu 16.04 LTS, not even as a symbolic link to/var/run/motd
. If it is created, however its contents will be printed too. -
/var/run/motd
– This was used by Ubuntu’s first implementation. It is not used anymore. It is just ignored by PAM. -
/var/run/motd.dynamic
– This is what is shown on login currently. It is updated by/etc/init.d/motd
at every boot. It is also updated by PAM by running the scripts in/etc/update-motd.d/
, if they exist. -
/etc/motd.tail
– The Ubuntu packageused to
populate/etc/update-motd.d.
One of them would cat the contents of this file so it was easy to add static content. That script does not exist in the package anymore, so the file does not have the intended effect.
how to do
1 | mkdir /etc/update-motd.d |
1 | // in /etc/pam.d/sshd |
landscape-sysinfo
- /usr/lib/python3/dist-packages/landscape
- Display a summary of the current system status
1 | --version |
run-parts
- 照字母排序執行該資料夾下所有可執行文件
reference
- Temperature in Ubuntu MOTD
- bash - Colorize landscape-sysinfo - Ask Ubuntu
- Customize your MOTD login message in Debian and Ubuntu – Own your bits
- ubuntu - How can I edit the welcome message when ssh start? - Server Fault
- How to set a dynamic Message of the Day (motd) in Debian Jessie 8.2 for ssh? - Unix & Linux Stack Exchange
- Ubuntu Manpage: landscape-sysinfo - Display a summary of the current system status
- Ubuntu Manpage: update-motd - dynamic MOTD generation
- Ubuntu Manpage: pam_motd - Display the motd file