Ubuntu Geek

Ubuntu Linux Tutorials,Howtos,Tips & News | Gutsy,Hardy,Intrepid

  • RSS Feed

    subscribe to the ubuntu Geek RSS feed

  • Follow Us on Twitter

  • Sponsor


  • Categories

  • Meta

  • Sponsor

  • Archives

  • Support Ubuntugeek

    Amount $:
    Website(Optional):


  • Favourite Sites

How to change message of the day (MOTD) in Ubuntu server

Posted by admin on September 3rd, 2008 Email This Post Email This Post

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

The contents of /etc/motd are displayed by login after a successful login but just before it executes the login shell.

The abbreviation “motd” stands for “message of the day”, and this file has been traditionally used for exactly that (it requires much less disk space than mail to all users).

If you want to change this message in ubuntu server follow this procedure first you need to edit /etc/motd.tail file

sudo vi /etc/motd.tail

Enter your message save and exit the file

Now you can restart your ubuntu server to check your changes are working or not

For Ubuntu Intrepid Users

There is a new package that provides this functionality with more options, called update-motd, available in Ubuntu Universe for Intrepid.

Install update-motd in Ubuntu Intrepid

sudo aptitude install update-motd

This will complete the installation

This package seeks to make the /etc/motd (Message of the Day) more dynamic and valuable, by providing a simple, clean framework for defining scripts whose output will regularly be written to /etc/motd.

The update-motd package creates a directory, /etc/update-motd.d, and installs a cronjob, /etc/cron.d/update-motd, which calls /usr/sbin/update-motd every 10 minutes (by default).

/usr/sbin/update-motd uses run-parts to execute each script in /etc/update-motd.d in lexigraphic order, concatenating the results with the message-of-the-day header, /etc/motd.tail.

In this way, users, or even other packages can drop scripts into /etc/update-motd.d to affect the MOTD.

Example

create a script, such as /etc/update-motd.d/10-stats

sudo vi /etc/update-motd.d/10-stats

add the following lines and save the file.

#!/bin/sh
echo
date
echo
who
echo

Make sure you chmod +x /etc/update-motd.d/10-stats.Then, you can either run /usr/bin/update-motd, or uptimeWait ~10 minutes and then log in.

This is very simple and great idea where you can see whatever information you want when you login in to your server.

Share/Save/Bookmark

Related Articles

5 Responses to “How to change message of the day (MOTD) in Ubuntu server”

  1. shadowfirebird Says:

    I think you will find that /etc/motd is only displayed on text-logins, not GUI ones (on what used to be init level 3, if that helps explain anything).

    So — unless I’m mistaken — the vast majority of us don’t see that text.

  2. admin Says:

    @shadowfirebird

    You can see this MOTD message if you are logging using ssh,telnet etc

  3. shadowfirebird Says:

    Granted. But, it depends on the telnet/ssh server. Some do, some don’t.

  4. admin Says:

    The contents of /etc/motd are displayed by login after a successful login but just before it executes the login shell.

    it depends on the telnet/ssh server. Some do, some don’t

    Not really.I have been using debian,ubuntu,redhat linux servers everytime when you login using ssh or telnet you should see similar to the following message

    Linux t61p 2.6.26-5-generic #1 SMP Fri Aug 15 13:54:22 UTC 2008 x86_64

    The programs included with the Ubuntu system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.

    To access official Ubuntu documentation, please visit:
    http://help.ubuntu.com/

  5. Brian Says:

    If you want an easy way to silence motd for a single user, run touch ~/.hushlogin. Personally, I find motd annoying.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>