On a base install of Ubuntu 14.04.2 LTS, simply drop the message you want in:
/etc/motd
By default, the MOTD will appear at the end of the other dynamic MOTD content. For example, here's the output from a Vagrant ubuntu/trusty64 (v20150506.0.0) box with a /etc/motd file added:
$ vagrant ssh
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-52-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Thu May 14 20:06:56 UTC 2015
System load: 0.39 Processes: 78
Usage of /: 2.8% of 39.34GB Users logged in: 0
Memory usage: 24% IP address for eth0: 10.0.2.15
Swap usage: 0%
Graph this data and manage this system at:
https://landscape.canonical.com/
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.
#####################################
Howdy! This message is from /etc/motd
#####################################
Last login: Thu May 14 20:06:56 2015 from 10.0.2.2
vagrant@vagrant-ubuntu-trusty-64:~$
That's all there is to it if you're working on a system with the default settings.
Some other troubleshooting notes:
Using "/etc/motd" is a change from earlier versions. Recommendations for 12.02 were to use "/etc/motd.tail". That doesn't work in 14.04.2.
Other recommendations I've seen include changing some values in "/etc/ssh/sshd_config". In case those have been altered, here's the defaults that work:
UsePAM yes
PrintMotd no
Likewise, here are the defaults for the /etc/pam.d/login
I've seen referenced:
session optional pam_motd.so motd=/run/motd.dynamic noupdate
session optional pam_motd.so
That's everything I've seen referenced for troubleshooting.
sudo run-parts /etc/update-motd.d/
display the expected information? – Seth Oct 18 '14 at 21:43/etc/pam.d/login
are present two uncommented lines that start withsession optional pam_motd.so
– Lety Oct 25 '14 at 15:07session optional pam_motd.so motd=/run/motd.dynamic noupdate
andsession optional pam_motd.so
– alxlvt Oct 25 '14 at 19:00PrintMotd
andUsePAM
in/etc/ssh/sshd_config
are set to yes? – Lety Nov 03 '14 at 22:08PrintMotd yes
was in there, but nothing aboutUsePAM
. – alxlvt Nov 04 '14 at 23:28UsePAM yes
and let's see if it fix the problem. Also, please could you add @Letizia in your comment otherwise I will not get notification. – Lety Nov 13 '14 at 22:59