Written in pure Bash. No need to install any package. Tested with the Arch Linux ARM distribution.
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.shThe following steps may vary depending on the OS.
-
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 themotd.shscript in the directory/etc/profile.dand it will be executed after the login. More about autostarting scripts. -
Remove the default MOTD. In Arch Linux ARM you need to remove the
/etc/motdfile.$ sudo rm /etc/motd
-
Remove the "last login" information. In Arch Linux ARM you need to disable the
PrintLastLogoption from thesshdservice. Edit the/etc/ssh/sshd_configfile and uncomment the line#PrintLastLog yes:$ sudo nano /etc/ssh/sshd_config
Before:
#PrintLastLog yesAfter:
PrintLastLog noRestart the
sshdservice:$ 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).
