Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My /etc/motd file is showing duplicate messages. When I edit it manual, it keeps returning to the messed up version whenever a user logs in. How do I stop this? I'm using Ubuntu 10.04

share|improve this question
up vote 5 down vote accepted

The MOTD is generated by a script. To prevent the default MOTD from reverting, remove the execute bit from the /etc/update-motd.d/00-header file and put your desired MOTD text into /etc/motd.tail. Or, to keep the default MOTD text and just append your own text to it, leave the 00-header file alone and add your text to the motd.tail file.

share|improve this answer
Thanks - the duplicate message was in motd.tail - changing it fixed the issue – MrD Apr 28 '11 at 6:33

By default, in recent releases of Debian and Ubuntu (including yours), /etc/motd is a symbolic link to /var/run/motd, which is regenerated at each login by the update-motd framework.

If you want a static /etc/motd remove a symbolic link and create a regular file in its place. Or you can edit the pam_motd calls in /etc/pam.d/* and pass motd=/etc/motd.dougk.

The underlying issue is probably due to some breakage in /etc/update-motd.d/*, possibly a backup file duplicating the effect of the corresponding main file.

share|improve this answer
How this helped me fix it: I commented out one of the pam_motd lines in /etc/pam.d/ and now I'm back to a single MOTD. Thanks! – adam_0 Jan 30 '13 at 18:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.