Message of the Day for the Raspberry Pi
Written in pure Bash. No need to install any package. Tested with the Arch Linux ARM and Raspbian distributions.
Download and save the
motd.sh bash script in the Raspberry Pi. Remember to add execution permissions and change the owner:
$ sudo chown root:root motd.sh $ sudo chmod +x motd.sh
The following steps may vary depending on the OS. Arch Linux ARM is assumed.
Autoexecute the script when the user logs in. There are multiple locations from where you can start the
motd.shscript, for example using the
/etc/profile. Save the
motd.shscript in the directory
/etc/profile.dand it will be executed after the login. More about autostarting scripts.
Remove the default MOTD. It is located in
$ sudo rm /etc/motd
Remove the "last login" information. Disable the
PrintLastLogoption from the
sshdservice. Edit the
/etc/ssh/sshd_configfile and uncomment the line
$ sudo nano /etc/ssh/sshd_config
$ sudo systemctl restart sshd
Note: If you don't see the degree Celsius character correctly (
º) make sure you have enabled a UTF8 locale (Arch Linux locales).