Create a file motd.sh with contents you want to publish when logging in to the server and copy it
/etc/profile.d
and make it executable
chmod +x /etc/profile.d/motd.sh
When logoff and login back you would see the message.
My file (motd.sh) contains:
echo “***************************” > /etc/motd
echo “# This is my Rpi2” >> /etc/motd
echo “***************************” >> /etc/motd
When I login to my Rpi, I see the following:
Last login: Thu Nov 14 19:21:13 2019 from 10.xx.xx.xx
***************************
# This is my Rpi2
***************************