0

I have an Ubuntu server running at sandbox.plushu.org - if you add your key at http://enter.sandbox.plushu.org, you can connect to the server as root@sandbox.plushu.org. You can reset the server by pressing the reset button on http://reset-sandbox.plushu.org.

I have a custom time-sensitive MOTD on this server. The problem that I'm seeing is that this MOTD, when regenerated (via /etc/update-motd/*) at login, is not displayed until the next login. The first time you log in, you will see the MOTD as generated at boot: the next time you log in, you will see the MOTD as generated the last time you logged in.

What is causing this behavior? How can it be fixed so that, on logging in, the MOTD is generated, then displayed?

4

This behaviour is configured in /etc/pam.d/sshd:

session    optional     pam_motd.so  motd=/run/motd.dynamic noupdate

Try to remove "noupdate" keyword.

As described in http://manpages.ubuntu.com/manpages/precise/man8/pam_motd.8.html - it means..

Don't run the scripts in /etc/update-motd.d to refresh the motd file.

  • Holy cow, that fixed it! What a bizarre and counter-intuitive option. Why is this set out of the box when the default MOTD contains things like system stats? – Stuart P. Bentley Sep 2 '14 at 20:24
  • This appears to be a problem as of 2015-nov-7 on DigitalOcean hosting. I used this technique to fix it. – Volomike Nov 7 '15 at 13:16

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.