Ubuntu 9.04: Edit your Message of the Day (MOTD)
by Adam on Oct.07, 2009, under Linux, Ubuntu 9.04
If you log into your Linux box with SSH at all, you will notice that it displays a little message to you telling you some basic info about the system and the GPL if I recall. Well, if you’d like to change your MOTD to display whatever you want, this is how.
It’s pretty simple. There is a file, /etc/motd, and that is the text that is displayed as your message of the day. But you are not meant to edit this file directly. If you do, the next time your PC reboots, it’ll revert to its old MOTD. That is because Ubuntu has another file called /etc/motd.tail, THIS is the file you edit.
In a terminal type:
(You will need root for this since we’re changing a file in the /etc/ directory, so issue this command as sudo if you need to or commit a su just before)
The file will probably have some text in there, which you can leave as is, or change to your desires. The purpose if this file is to be read into the /etc/motd file by the terminal command update-motd. Once you have edited the /etc/motd.tail file, run the update-motd command and now your /etc/motd file will be updated with the contents of the /etc/motd.tail file. Pretty simple right?
Additional Tip:
If you want to have some pretty ascii-art in your MOTD, it can be done easily in two distinct ways. You can either install a program called ‘figlet’ (sudo apt-get install figlet) or you can go to this website, which is basically a souped up figlet with an HTML frontend. The website is the one I used to create my MOTD. I named my PC FooBuntu and this is how it looks in my MOTD file, every time I log into my PC with SSH:
With figlet you can get the same thing, but the website makes it much less hassle. Just copy and paste right into your /etc/motd.tail file and run update-motd. Et voila!