Очевидно, что не 100% ubuntu, но я думаю, что обработка не так уж отличается.
/etc/motd - это просто символическая ссылка на var/run/motd, которая, в свою очередь, запускается системой с содержимым из /etc/mod.tail.
Так что это просто файл /etc/motd.tail, который вам нужно будет заполнить вашим сообщением, оставив все остальное неповрежденным, если вы не захотите нарушить эту схему.
Вот результат работы man motd на debian. Я думаю, что это так же для ubuntu, но лучше проверьте себя.
ОПИСАНИЕ The contents of /etc/motd are displayed by login(1) after a successful
login but just before it executes the login shell.
The abbreviation "motd" stands for "message of the day", and this file has
been traditionally used for exactly that (it requires much less disk space
than mail to all users).
On Debian GNU/Linux this file is a symbolic link pointing to /var/run.
The contents of this file are regenerated upon every system boot based on
the contents of /etc/motd.tail.
ФАЙЛЫ / etc / motd /etc/motd.tail ... и не забывайте чтобы убедиться, что модуль pam_motd запущен во время входа в систему. В противном случае вы не увидите ничего из своего сообщения.