Score:0

motd not showing up on Ubuntu 21.10

cn flag

Upon login I get a prompt and none of the stuff from /etc/update-motd.d

Version Welcome to Ubuntu 21.10 (GNU/Linux 5.13.0-30-generic x86_64)

If I run run-parts /etc/update-motd.d/ I get the expected output - it just doesn't run automatically upon login.

I don't have $HOME/.hushlogin configured at all.

Thanks!

waltinator avatar
it flag
How are you logging in? GUI, terminal emulator, `bash --login`, `agetty`, serial terminal or what? Read `man bash` about Startup Files read the startup files to see which one does the `run-parts /etc/update-motd.d/` and under what conditions.
hr flag
... it's done via PAM these days I think (`/etc/pam.d/login` for local sessions or `/etc/pam.d/sshd` for remote sessions)
salvo avatar
cn flag
@waltinator I'm logging in via SSH to the terminal, no GUI.
salvo avatar
cn flag
@steeldriver: I see that the `/etc/pam.d/sshd` file contains the `session optional pam_motd.so motd=/run/motd.dynamic` which doesn't exist on my system. I'll chase that down - thanks for the heads up!!
salvo avatar
cn flag
Thanks @steeldriver that worked. I needed to amend the `/etc/ssh/sshd_config` to allow PAM to be triggered. Thanks for the hint!!
hr flag
@salvo please consider turning your findings into an answer
Score:1
cn flag

Solved!

The file in /etc/ssh/sshd_config needed to be set this line UsePAM yes. That allowed the interactive login to trigger the file /etc/pam.d/sshd that contained session optional pam_motd.so motd=/run/motd.dynamic to run, which in turn ran the files in /etc/update-motd.d/ to trigger my MOTD when I login.

Ted H. avatar
et flag
Following the steps of the solution, I found the file "/run/motd.dynamic" did not exist, but "/run/motd.dynamic.new" did. I copied the "new" file to the expected name and it worked for me. Thanks.
Latra avatar
mg flag
the rename that @TedH. mentioned was also the solution for me. may you can edit the answer with this "additional step"? it could help :)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.