The motd (message of the day) is used for displaying message when user login into the system.You can display any kind of message on screen. Either it can be legal notice, information, planned outage, warning, alert or anything as per your requirement.
You only have to edit the file /etc/motd.
# vi /etc/motd
Unauthorized access to this server is strictly prohibited !!
Save the file /etc/motd.
Next need to modify /etc/ssh/sshd_config file in order to display motd message to suerrs accessing server by ssh.
#vi /etc/ssh/sshd_config
PrintMotd yes
Now restart or reload ssh service.
In Ubuntu / Debian:
#/etc/init.d/ssh restart
In CentOS / RHEL:
#/etc/init.d/sshd restart