Changing the MOTD in Linux

Last updated: May 10, 2024

Ok today is going to be a quick post on how to change the Message Of The Day or MOTD. This is the message that you will see when you first log into your shell either through ssh or on the machine.

The message of the day is really just a text file. It got its name because it was easier and used less disk space to send a message to all of your users than using email.

To change the MOTD you have to edit the /etc/motd file. Simply open it up with your favorite text editor. You can create it if it doesn’t exist:

vim /etc/motd

Type your message that you want to see and save it. The next time you login you should see your message!

If you want to just add a line to your MOTD without opening your text editor you can just use the echo command and appened (>>).

Note: Only root will have access to change the motd file.

echo "This is an added line to my message of the day" >> /etc/motd

If you want some cool ascii code in your MOTD install a small app called figlet:

apt-get install figlet

Then use it like this:

figlet text you want to convert or figlet test:

 _            _
| |_ ___  ___| |_
| __/ _ \/ __| __|
| ||  __/\__ \ |_
 \__\___||___/\__|

Other fun things

There are many other fun things you can add to your MOTD to spice it up. After adding some ascii text of maybe the computer’s name I like to put a quote or something funny.

I like to mix two programs, fortune and cowsay.

 ________________________________________
/ You will obey or molten silver will be \
\ poured into your ears.                 /
 ----------------------------------------
        \   ^__^
         \  (xx)\_______
            (__)\       )\/\
             U  ||----w |
                ||     ||

You can install both of these programs with apt or whatever package managment software your distro uses. On arch you can do sudo pacman -Syu cowsay figlet

Thats about it. Have fun…

Need to print shipping labels on your site?

Checkout my product RocketShipIt for simple easy-to-use developer tools for UPS™ FedEx™ USPS™ and more.

Get notified on new posts or other things I'm working on

Share: