I have created a test script below to add to /etc/update-motd.d/05-lsb-release
#!/bin/sh
echo
lsb_release -a
but when i have rebooted the machine, restarted SSH and connected to it through SSH i am not seeing the changes applied
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-105-generic x86_64)
0 packages can be updated. 0 updates are security updates.
Last login: Sun Dec 11 17:08:40 2016 from xxx.xxx.xxx.xxx
paul@ubuntu1404:~$
the output in /var/run/update-motd.dynamic is the same as above, however /var/run/update-motd.dynamic.new shows the correct information
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-105-generic x86_64)
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
0 packages can be updated.
0 updates are security updates.
how can i see the changes when i log in?
I am running the latest updates to Ubuntu 14.04.5 LTS
You might have an error in your motd script. Check it with:
run-parts /etc/update-motd.d/ > /dev/null
Should this command report errors you need to fix them.
It is configured in the PAM. Have a look into the file /etc/pam.d/sshd
. There is a line such as
session optional pam_motd.so noupdate
which prevents dynamic updates when logging in (your "dynamic" MoTD is quite static, so it does not make sense to update it with every login, isn't it?).
More described in the AskUbuntu.
Test your motd like the (ubuntu? maybe debian too?) system does
/usr/bin/env -i PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin run-parts --lsbsysinit /etc/update-motd.d
(taken from this blog https://ownyourbits.com/2017/04/05/customize-your-motd-login-message-in-debian-and-ubuntu/)
in my case, lolcat was dying on utf8 chars because it was being launched with an ASCII as its language, fixed by prefixing the lolcal invocation with LANG=en_US.UTF-8 lolcat ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With