How to Disable the Welcome Message (MOTD) When Logging into an Ubuntu Server

When you connect to an Ubuntu Linux server via SSH, the system greets you with a large block of text before displaying the command prompt. This is known as the “Message of the Day” (MOTD). By default, Ubuntu populates this message with system information, available package updates, promotional links for Ubuntu Pro, and general system statistics.

While this information can be helpful for a new deployment, it quickly becomes visual clutter if you are logging into the server multiple times a day. If you prefer a clean, instantly accessible command prompt, you can completely disable this welcome message.

Understanding How the MOTD Works in Ubuntu

Unlike older Linux distributions that relied on a single static file (/etc/motd), modern Ubuntu generates the welcome message dynamically using a series of executable scripts located in the /etc/update-motd.d/ directory.

To silence the welcome message, you must stop these scripts from executing when you log in.

How to Disable the Dynamic Welcome Message

The safest way to disable the MOTD is to remove the executable permissions from the scripts that generate it. This ensures that the operating system cannot run them during the login process.

  1. Log into your Ubuntu server via SSH or open your local terminal.
  2. To remove the executable permissions from all scripts in the MOTD directory, run the following command. You will need administrator (sudo) privileges: sudo chmod -x /etc/update-motd.d/*

This command instantly silences the dynamic system information, update notifications, and promotional text.

How to Hide the Last Login Message

Even after disabling the dynamic MOTD scripts, SSH will still print a line indicating your last login time (e.g., Last login: Mon Oct 23 10:00:00 2023 from 192.168.1.5).

If you want a completely blank screen when you log in, you must hide this final message on a per-user basis.

  1. Ensure you are logged in as the user whose login message you want to hide.
  2. Create a hidden file in your home directory named .hushlogin by running the following command: touch ~/.hushlogin

The existence of this empty file tells the SSH daemon to remain completely silent. Log out of your server and log back in. You will be greeted immediately by your clean, empty command prompt.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.