This document explains how to configure custom login messages on Ubuntu servers.
You can set messages to appear after login (MOTD) or before login (legal/security warning banners).
⚡ Pro tip for production servers:
If you want to display a serious legal warning (e.g., "Unauthorized access is prohibited…"), you should configure an SSH pre-login banner. This ensures the message is displayed before authentication, which helps with compliance.
************************************************************* WARNING: Unauthorized access to this system is forbidden ** and will be prosecuted to the fullest extent of the law. ** By logging in, you consent to monitoring and auditing. *************************************************************
Configure SSH to use the banner:
sudo nano /etc/ssh/sshd_config
Add or update the line:
Banner /etc/issue.net
Restart SSH:
sudo systemctl restart ssh
Test by opening a new SSH session.
The banner will appear before login, immediately after connecting.
Below is a commonly used enterprise-grade compliance banner suitable for production environments.
You can copy this directly into /etc/issue.net (for SSH) and /etc/issue (for console).
************************************************************************ NOTICE TO USERS ************************************************************************* This system is for the use of authorized users only. ** Individuals using this computer system without authority, or in ** excess of their authority, are subject to having all of their ** activities on this system monitored and recorded by system ** personnel. ** ** Anyone using this system expressly consents to such monitoring. ** If such monitoring reveals possible evidence of criminal activity, ** system personnel may provide the evidence of such monitoring to ** law enforcement officials. ** ** Unauthorized access or use is prohibited and may result in ** disciplinary action and/or civil and criminal penalties. ************************************************************************