Thursday 8 June 2017

Change Message Of The Day (MOTD) Banner Amazon EC2


Change Message Of The Day (MOTD) Banner Amazon EC2


Permanently change the MOTD banner on AWS EC2 Amazon Linux



I found out the hard way that hanging the /etc/motd file on  Amazon EC2 AMI only works until the image is rebooted. I only came to this conclusion after spending considerable time updating it with custom messages on numerous servers. On reboot I was dismayed that all my time had been wasted. To be honest I nearly just left it as default. After all the MOTD messages that I had created with ASCII art (well an online generator ;-)) in order to wow my peers the next time someone had to logo on to grab a log file or bounce a service were not exactly essential for us to carry out our jobs. If there ever was a nice to have added to a system configuration after deployment then adding a MOTD banner was a great example.

After some perseverance I finally got to the bottom of it.



It is actually generated by a script at /usr/sbin/update-motd and the banner you see can be found at /etc/update-motd.d/30-banner. Turn off the update script with
$ sudo update-motd --disable
and then edit the banner at /etc/update-motd.
Simple when you know whats going on under the hood!
Amazon Elastic Cloud Computing
https://aws.amazon.com/ec2/

No comments:

Post a Comment