<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to change message of the day (MOTD) in Ubuntu server</title>
	<atom:link href="http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html</link>
	<description>Ubuntu Linux Tutorials,Howtos,Tips &#38; News &#124; Oneiric,Natty,Maverick</description>
	<lastBuildDate>Mon, 06 Feb 2012 15:40:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: gr8can8dian</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-102100</link>
		<dc:creator>gr8can8dian</dc:creator>
		<pubDate>Sun, 24 Apr 2011 11:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-102100</guid>
		<description>### Posted for Posterity ###
Ubuntu 10.04 LTS 32-Bit Server Edition
I run a headless server as a gateway, the &quot;Message of The Day&quot; is an essential tool for quickly seeing what is happening on a server. The &quot;motd&quot; script is also linked to my aliases file so that this info can be accessed quickly.

### Fiction About &quot;update-motd&quot; ###

The update-motd package creates a directory &quot;/etc/update-motd.d&quot; (TRUE)
Installs a cronjob, &quot;/etc/cron.d/update-motd&quot; (NOT!!!)
Cron calls /usr/sbin/update-motd every 10 minutes by default (NOT!!!)

The command &quot;/usr/sbin/update-motd&quot; 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 &quot;/etc/motd.tail&quot;. (NOT!!!)

### The TRUTH About MOTD ###
Follow these steps:

1) Install the helper package for customizing motd.
apt-get install update-motd

2) Make ONE executable script in &quot;/etc/update-motd.d&quot;. Get rid of all the other scripts in /etc/update-motd.d and use ONE script &quot;10-scriptname&quot;, where &quot;scriptname&quot; is the name of your file without any file extensions. For some reason, all the other scripts you try to create will NEVER get executed.

3) Make a symlink in &quot;/etc/update-motd.d&quot; to a script in a SAFE directory just to be sure that you never lose it (just in case there is a distro update and update-motd gets DEPRECATED).
cd /etc/update-motd.d
ln -s /path/to/your/script 10-scriptname

4) An updated motd will be created ONLY when you login. The &quot;/usr/sbin/update-motd&quot; command does not exist anymore. The cron job is also now fictional/legendary.
 
5) Fact: &quot;update-motd&quot; is already partially deprecated (see below)
Name: 	update-motd
Description: superceded by pam_motd in libpam-modules
http://www.ubuntuupdates.org/packages/show/162501

Here is a sample script for some very useful (not annoying) information:

#!/bin/bash
function mydate(){
  strDayofMonth=$(date +%d)
  intLength=${#strDayofMonth}
  intOff=$(($intLength-1))
  strDayPart=${strDayofMonth:intLength:intOff}

  case $strDayPart in

     1)
        strOrdinal=&quot;st&quot;
     ;;
 
     2)
        strOrdinal=&quot;nd&quot;
     ;;

     3)
        strOrdinal=&quot;rd&quot;
     ;;

     *)
        strOrdinal=&quot;th&quot;
     ;;

  esac
  day=$(date +%d &#124; sed &#039;s/^0//&#039;)
  myDate=$(date +%A&quot; &quot;%B&quot; $day$strOrdinal, &quot;%Y&quot; at &quot;%l&quot;:&quot;%M%P&quot; &quot;%Z)
}

echo

### START MESSAGE OF THE DAY ###
cal
echo -n &quot;\&quot;$(hostname)\&quot; $(cat /etc/issue)-$(uname -r)&quot;;echo
mydate
echo $myDate
echo

### PHYSICAL DRIVE USAGE ###
drives=$(df &#124; grep &quot;/dev/sd&quot; &#124; awk &#039;{print $1}&#039;)
echo &quot;Disk Usage&quot;
echo &quot;----------&quot;
echo &quot;$(df -h --total $drives)&quot;
echo

### IPV4 INTERFACE INFORMATION ###
echo &quot;Interfaces&quot;
echo &quot;----------&quot;
list=$(ifconfig &#124; grep &quot;eth&quot; &#124; awk &#039;{print $1}&#039;)
for item in $list; do
  address=$(ifconfig $item &#124; grep &quot;inet addr&quot; &#124; awk &#039;{print $2}&#039; &#124; cut -d &quot;:&quot; -f2)
  echo &quot;IPV4 Address of $item is $address&quot;
done
echo

### SYSTEM INFORMATION ###
echo &quot;System Info&quot;
echo &quot;-----------&quot;
pcount=$(ps aux &#124; wc -l)
phymem=$(free -m &#124; grep &quot;Mem:&quot; &#124; awk &#039;{printf &quot;%d%%\n&quot;, $3*100/$2}&#039;)
swapmem=$(free -m &#124; grep &quot;Swap:&quot; &#124; awk &#039;{printf &quot;%d%%\n&quot;, $3*100/$2}&#039;)
echo &quot;Total Processes: $pcount&quot;
echo &quot;Physical memory usage: $phymem&quot;
echo &quot;Swap memory usage: $swapmem&quot;
echo

### USER LOGIN INFORMATION ###
echo &quot;Login Info&quot;
echo &quot;----------&quot;
logins=$(who &#124; wc -l)
echo &quot;Number of users logged in: $logins&quot;
who
echo

exit 0</description>
		<content:encoded><![CDATA[<p>### Posted for Posterity ###<br />
Ubuntu 10.04 LTS 32-Bit Server Edition<br />
I run a headless server as a gateway, the &#8220;Message of The Day&#8221; is an essential tool for quickly seeing what is happening on a server. The &#8220;motd&#8221; script is also linked to my aliases file so that this info can be accessed quickly.</p>
<p>### Fiction About &#8220;update-motd&#8221; ###</p>
<p>The update-motd package creates a directory &#8220;/etc/update-motd.d&#8221; (TRUE)<br />
Installs a cronjob, &#8220;/etc/cron.d/update-motd&#8221; (NOT!!!)<br />
Cron calls /usr/sbin/update-motd every 10 minutes by default (NOT!!!)</p>
<p>The command &#8220;/usr/sbin/update-motd&#8221; 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 &#8220;/etc/motd.tail&#8221;. (NOT!!!)</p>
<p>### The TRUTH About MOTD ###<br />
Follow these steps:</p>
<p>1) Install the helper package for customizing motd.<br />
apt-get install update-motd</p>
<p>2) Make ONE executable script in &#8220;/etc/update-motd.d&#8221;. Get rid of all the other scripts in /etc/update-motd.d and use ONE script &#8220;10-scriptname&#8221;, where &#8220;scriptname&#8221; is the name of your file without any file extensions. For some reason, all the other scripts you try to create will NEVER get executed.</p>
<p>3) Make a symlink in &#8220;/etc/update-motd.d&#8221; to a script in a SAFE directory just to be sure that you never lose it (just in case there is a distro update and update-motd gets DEPRECATED).<br />
cd /etc/update-motd.d<br />
ln -s /path/to/your/script 10-scriptname</p>
<p>4) An updated motd will be created ONLY when you login. The &#8220;/usr/sbin/update-motd&#8221; command does not exist anymore. The cron job is also now fictional/legendary.</p>
<p>5) Fact: &#8220;update-motd&#8221; is already partially deprecated (see below)<br />
Name: 	update-motd<br />
Description: superceded by pam_motd in libpam-modules<br />
<a href="http://www.ubuntuupdates.org/packages/show/162501" rel="nofollow">http://www.ubuntuupdates.org/packages/show/162501</a></p>
<p>Here is a sample script for some very useful (not annoying) information:</p>
<p>#!/bin/bash<br />
function mydate(){<br />
  strDayofMonth=$(date +%d)<br />
  intLength=${#strDayofMonth}<br />
  intOff=$(($intLength-1))<br />
  strDayPart=${strDayofMonth:intLength:intOff}</p>
<p>  case $strDayPart in</p>
<p>     1)<br />
        strOrdinal=&#8221;st&#8221;<br />
     ;;</p>
<p>     2)<br />
        strOrdinal=&#8221;nd&#8221;<br />
     ;;</p>
<p>     3)<br />
        strOrdinal=&#8221;rd&#8221;<br />
     ;;</p>
<p>     *)<br />
        strOrdinal=&#8221;th&#8221;<br />
     ;;</p>
<p>  esac<br />
  day=$(date +%d | sed &#8216;s/^0//&#8217;)<br />
  myDate=$(date +%A&#8221; &#8220;%B&#8221; $day$strOrdinal, &#8220;%Y&#8221; at &#8220;%l&#8221;:&#8221;%M%P&#8221; &#8220;%Z)<br />
}</p>
<p>echo</p>
<p>### START MESSAGE OF THE DAY ###<br />
cal<br />
echo -n &#8220;\&#8221;$(hostname)\&#8221; $(cat /etc/issue)-$(uname -r)&#8221;;echo<br />
mydate<br />
echo $myDate<br />
echo</p>
<p>### PHYSICAL DRIVE USAGE ###<br />
drives=$(df | grep &#8220;/dev/sd&#8221; | awk &#8216;{print $1}&#8217;)<br />
echo &#8220;Disk Usage&#8221;<br />
echo &#8220;----------&#8221;<br />
echo &#8220;$(df -h --total $drives)&#8221;<br />
echo</p>
<p>### IPV4 INTERFACE INFORMATION ###<br />
echo &#8220;Interfaces&#8221;<br />
echo &#8220;----------&#8221;<br />
list=$(ifconfig | grep &#8220;eth&#8221; | awk &#8216;{print $1}&#8217;)<br />
for item in $list; do<br />
  address=$(ifconfig $item | grep &#8220;inet addr&#8221; | awk &#8216;{print $2}&#8217; | cut -d &#8220;:&#8221; -f2)<br />
  echo &#8220;IPV4 Address of $item is $address&#8221;<br />
done<br />
echo</p>
<p>### SYSTEM INFORMATION ###<br />
echo &#8220;System Info&#8221;<br />
echo &#8220;-----------&#8221;<br />
pcount=$(ps aux | wc -l)<br />
phymem=$(free -m | grep &#8220;Mem:&#8221; | awk &#8216;{printf &#8220;%d%%\n&#8221;, $3*100/$2}&#8217;)<br />
swapmem=$(free -m | grep &#8220;Swap:&#8221; | awk &#8216;{printf &#8220;%d%%\n&#8221;, $3*100/$2}&#8217;)<br />
echo &#8220;Total Processes: $pcount&#8221;<br />
echo &#8220;Physical memory usage: $phymem&#8221;<br />
echo &#8220;Swap memory usage: $swapmem&#8221;<br />
echo</p>
<p>### USER LOGIN INFORMATION ###<br />
echo &#8220;Login Info&#8221;<br />
echo &#8220;----------&#8221;<br />
logins=$(who | wc -l)<br />
echo &#8220;Number of users logged in: $logins&#8221;<br />
who<br />
echo</p>
<p>exit 0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: F@k@name</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-12441</link>
		<dc:creator>F@k@name</dc:creator>
		<pubDate>Fri, 28 Aug 2009 19:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-12441</guid>
		<description>1.vi /etc/motd.tail
2.cat /etc/motd.tail &gt; /var/run/motd</description>
		<content:encoded><![CDATA[<p>1.vi /etc/motd.tail<br />
2.cat /etc/motd.tail &gt; /var/run/motd</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Satellite</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-11500</link>
		<dc:creator>Satellite</dc:creator>
		<pubDate>Mon, 27 Jul 2009 10:23:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-11500</guid>
		<description>LOL :)

P.S. Thanks for the article! Interesting and actual as I&#039;ve been just searching for this howto.</description>
		<content:encoded><![CDATA[<p>LOL <img src='http://www.ubuntugeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>P.S. Thanks for the article! Interesting and actual as I&#8217;ve been just searching for this howto.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dev</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-9180</link>
		<dc:creator>Dev</dc:creator>
		<pubDate>Tue, 19 May 2009 21:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-9180</guid>
		<description>I find operating systems that don&#039;t follow age-old conventions annoying.</description>
		<content:encoded><![CDATA[<p>I find operating systems that don&#8217;t follow age-old conventions annoying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-4274</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Fri, 05 Sep 2008 01:15:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-4274</guid>
		<description>If you want an easy way to silence motd for a single user, run touch ~/.hushlogin.  Personally, I find motd annoying.</description>
		<content:encoded><![CDATA[<p>If you want an easy way to silence motd for a single user, run touch ~/.hushlogin.  Personally, I find motd annoying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-4278</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 03 Sep 2008 09:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-4278</guid>
		<description>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/</description>
		<content:encoded><![CDATA[<p>The contents of /etc/motd are displayed by login after a successful login but just before it executes the login shell.</p>
<p>it depends on the telnet/ssh server. Some do, some don’t</p>
<p>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</p>
<p> Linux t61p 2.6.26-5-generic #1 SMP Fri Aug 15 13:54:22 UTC 2008 x86_64</p>
<p>  The programs included with the Ubuntu system are free software;<br />
  the exact distribution terms for each program are described in the<br />
  individual files in /usr/share/doc/*/copyright.</p>
<p>  Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by<br />
  applicable law.</p>
<p>  To access official Ubuntu documentation, please visit:<br />
  <a href="http://help.ubuntu.com/" rel="nofollow">http://help.ubuntu.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shadowfirebird</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-4277</link>
		<dc:creator>shadowfirebird</dc:creator>
		<pubDate>Wed, 03 Sep 2008 08:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-4277</guid>
		<description>Granted.   But, it depends on the telnet/ssh server.  Some do, some don&#039;t.</description>
		<content:encoded><![CDATA[<p>Granted.   But, it depends on the telnet/ssh server.  Some do, some don&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-4276</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 03 Sep 2008 08:42:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-4276</guid>
		<description>@shadowfirebird

You can see this MOTD message if you are logging using ssh,telnet etc</description>
		<content:encoded><![CDATA[<p>@shadowfirebird</p>
<p>You can see this MOTD message if you are logging using ssh,telnet etc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shadowfirebird</title>
		<link>http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html/comment-page-1#comment-4275</link>
		<dc:creator>shadowfirebird</dc:creator>
		<pubDate>Wed, 03 Sep 2008 08:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.ubuntugeek.com/?p=592#comment-4275</guid>
		<description>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&#039;m mistaken -- the vast majority of us don&#039;t see that text.</description>
		<content:encoded><![CDATA[<p>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).</p>
<p>So -- unless I&#8217;m mistaken -- the vast majority of us don&#8217;t see that text.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

