bknd logo

System Messages

How to setup custom messages

Custom Login Messages on Ubuntu Servers

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).


1. Custom MOTD (Message of the Day)

Ubuntu uses dynamic MOTD scripts stored in /etc/update-motd.d/. These scripts generate the message shown to users after logging in via SSH or console.

Create a Custom MOTD Script

  1. Create a new script file:

    sudo nano /etc/update-motd.d/99-custom
  2. Add your custom message:

    #!/bin/bash
    echo "🔥 Welcome to $(hostname) - Managed by King Assie 🔥"
  3. Make the script executable:

    sudo chmod +x /etc/update-motd.d/99-custom
  4. Log out and log back in to see the message.

Example Output

🔥 Welcome to server01 - Managed by King Assie 🔥

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.

  1. Edit the banner file:

    sudo nano /etc/issue.net

    Example contents:

    ************************************************************
    * 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.   *
    ************************************************************
  2. Configure SSH to use the banner:

    sudo nano /etc/ssh/sshd_config

    Add or update the line:

    Banner /etc/issue.net
  3. Restart SSH:

    sudo systemctl restart ssh
  4. Test by opening a new SSH session. The banner will appear before login, immediately after connecting.


3. Console Login Banner (Optional)

To display the same message on local console (tty) logins, also edit:

sudo nano /etc/issue

Place the same warning message there. This ensures users see the warning whether they log in via SSH or physically at the server console.


✅ Summary

  • MOTD scripts (/etc/update-motd.d/) → Show custom messages after login.
  • SSH banner (/etc/issue.net + sshd_config Banner) → Show legal warnings before login.
  • Console banner (/etc/issue) → Show warnings on physical/tty logins.

Use MOTD for fun/admin info (system status, welcome messages). Use SSH/console banners for compliance and legal notices.


4. Example Enterprise Compliance Banner

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.            *
***********************************************************************