8

I'd like to set a custom motd ("message of the day") on my machine (currently Mac OS X 10.6.5 using Bash with Terminal.app).

In /etc/ there was no motd file so I created one with some sample text. But the message doesn't show up when I restart Terminal. I've tried to logout and then login but it still doesn't seem to kick in.

If I do ls -l /etc/motd I get (if it's any clue):

-rw-r--r-- 1 root wheel 30 7 Dec 11:58 /etc/motd

Am I missing something?

3 Answers 3

8

Seems I worked it out. My motd not showing up must have been due to the fact that I had touched/added an empty file in my home directory called .hushlogin, which actually supresses any login messages (seems it doesn't just kill motd but any other login messages as well, as I understand it). At any rate, my problem is somehow solved and chances are I forgot to delete that .hushlogin file.

1
0

Depending on your distribution, the system may create a new motd automatically on each startup. Ubuntu seems to be doing that at least.

Cheers

2
  • Yes, that may be the case with my distro as well (Darwin/BSD). At there is this "Last login: Tue Dec 7 16:10:04 on ttys000" message each time I fire up a new Terminal frame.
    – Henrik
    Dec 7, 2010 at 19:22
  • An empty .hushlogin file in your ~ dir will hide any motd and the message I mentioned in my prev. comment above.
    – Henrik
    Dec 11, 2010 at 3:28
0

This depends on your distribution.

In general you can create /etc/motd file and contents will show on login, together with contents from /etc/motd.dynamic.

If you create /etc/update-motd.d and place scripts there they will populate /etc/motd.dynamic.

Some distros modify /etc/motd.dynamic in /etc/init.d/motd

See details here

https://ownyourbits.com/2017/04/05/customize-your-motd-login-message-in-debian-and-ubuntu/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .