There are several ways to go about fixing this. The first is to know that the MOTD is created upon bootup with /etc/init.d/bootmisc.sh. If you look at that line:
# Update motd uname -snrvm > /var/run/motd [ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
The file /etc/motd is a symlink to /var/run/motd. So you have a few choices:
- Comment out that portion in /etc/init.d/bootmisc.sh
- Change /etc/motd.tail (if you don't mind the uname info up top, or change that in bootmisc.sh)
- Link /etc/motd to something else. Like /etc/motd.static
- Make your own script that changes the MOTD in rc.local, via a cron job, etc...
I kind of like the old UNIX style of doing MOTD back at the University of Maryland. Our MOTD really was a "message of the day," and changed when we had something new to say to people logging in (which was about every day, sometimes twice a day). A few years ago, I worked with a company that modified Red Hat 9 to do some nifty "professional touches," to their systems, and one of them I liked was automatically having BIG FONTS in their MOTD. By that I mean, when you renamed a system, like to "SYSTEM54.SRV," when you logged in, the banner would say, automatically:
______ ______ _____ _____ __ __ ____ _ _ ____ ______ __ / ___\ \ / / ___|_ _| ____| \/ | ___|| || | / ___|| _ \ \ / / \___ \\ V /\___ \ | | | _| | |\/| |___ \| || |_ \___ \| |_) \ \ / / ___) || | ___) || | | |___| | | |___) |__ _| ___) | _ < \ V / |____/ |_| |____/ |_| |_____|_| |_|____/ |_|(_)____/|_| \_\ \_/ Greetings fellow Star Gazers! System last booted: system boot 2009-03-29 09:58
How did they do that? That's when I learned (today) about figlet. It's not in the main free repositories, so you'll have to add:
deb http://ftp.us.debian.org/debian lenny main non-free
to your sources.list and run an apt-get update (assuming you have Lenny, replace Etch or Intrepid or whatever if you're not on vanilla Debian 5.0). Then do apt-get install figlet. Do a man figlet to get all the options, but the base font was fine for me.
figlet SYSTEM54.SRV && printf '\nGreetings fellow Star Gazers!\n' && printf "System last booted:" && who -b
gave me the output above.
Pretty cool, huh? There's all kinds of info you can slap in there. Keep in mind, the MOTD is not a dynamic file, you have to manually change it somehow. If you want neat stuff like "you last logged in," or some random fortune, that's done in the .bash_login file (for bash).