Bash & EC2 – Set custom MotD on EC2 instance

Bash

This is just a simple tweak that I like to add to hosts to remind the user which host they are connecting to.  This message will print in the terminal window on ssh login, until its changed or removed.

MotD = Message of the Day.  A message that prints to screen on ssh login to a host.

  1. Remove sym-linked MotD
    sudo rm /etc/motd
  2. Create new MotD
    sudo nano /etc/motd
    Add custom message, something like:

    ############################################
    #    WARNING: This is a production Host    #      
    #  prod.db1.domain.tld  - xxx.xxx.xxx.xxx  #
    #  Contact: John Doe, johndoe@example.com  #
    ############################################
  3. Disconnect and reconnect to see MotD

Leave a Reply

Your email address will not be published. Required fields are marked *