Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

up vote 3 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 –  dougk 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

 
discard

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.