Changing Amazon AMI MOTD

Ever wonder how EC2 logo appear when you login ssh? Want to change/add logo to be appear to ssh login user? This maybe old and can find in other blogs. Anyway, here is how to do it in Amazon AMI.

When you list the directory /etc/update-motd.d, you will see

30-banner (where EC2 logo stored)
70-available-updates
75-system-updates

If you want to change just logo, edit 30-banner only, of course with root user. If you want additional script to run, add new file, such as 80-stats, where you can define sh command. Below is example :

#!/bin/sh
uptime
echo "-----"
df -h

If you are adding new file, don’t forget to give executable permission to new file, for example, run chmod +x /etc/update-motd.d/10-newfiles. After all that, you need to run /usr/sbin/update-motd to take affect of your changes.

Are you thinking of numbers at the start of file name, like 30, 70, 75? It is display sequences. In this example, 30 will display first and then followed by 70 and 75. So you can arrange your message order this way.

By the way MOTD stands ofr message of the day!

Also read...

Leave a Reply