Create a logon banner in Linux

One file that may be edited is the /etc/motd file. To create a nice custom /etc/motd using ASCII / ANSI fonts, there is a little gem that can be installed on the local Linux box to allow you create some spectacular fonts, it is called figlet. Once you have added the epel repository to your system, it is as simple as a yum install.

yum install figlet

figlet-installOnce installed, the command figlet is all that is needed.


Since the name is wrapped, use the -w to give it more width.

figlet -w 125

figlet-basic-exampleAdd color with these more complicated examples.

figlet-webaddressThen redirect the output to a new /etc/motd.

echo -e "\e[01;36m$(figlet -w 150 -f standard\e[00m" > /etc/motd

Alternately, since "-f standard" is the default font, this can be left off. To make it more universal, the variable $HOSTNAME can be subsistuted for the server name.  The example below, will redirect he output to a new /etc/motd.

echo -e "\e[01;36m$(figlet -w 150 $HOSTNAME)\e[00m" > /etc/motd