0

What parameters can be passed to the bash shell so that it displays the motd?

Shouldn't bash -l display the motd?

2

No, bash -l does not display the Message of the Day. From motd(5)'s manual page:

NAME motd - message of the day

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

To have your shell do it, add cat /etc/motd to your profile or shell rcfile.

  • I'm on Ubuntu 16 and am using a dynamically generated motd that changes, so when I ssh in I can see a different motd every time but if I just cat the motd file it doesn't change unless I ssh in again. – LINUX G33NYUS Oct 11 '17 at 18:23
  • As I said, that's presented by PAM, not your shell. In this case, for details, check man update-motd. – DopeGhoti Oct 11 '17 at 18:27
  • Dynamically created motd may add latency to your login that is undesirable. – Ed Neville Oct 11 '17 at 18:51
  • Since Ubuntu's out-of-the-box MOTD is already dynamic, I don't think that would be too much of a concern in this case. – DopeGhoti Oct 11 '17 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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