Disable Login Message on Linux

Disable Login Message on Linux

When you log into a Linux system via SSH or a terminal session, you often see system messages such as the Message of the Day (MOTD), last login information, and other notices. While these messages can be useful, they may also be unnecessary or clutter the terminal. This tutorial explains how to disable login message on Linux.

Here how login message looks like on an Ubuntu system:

Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-31-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.
Last login: Sun Mar 16 05:47:18 2025 from 192.168.0.2

Disabling the login message is straightforward and only requires creating an empty file .hushlogin in the home directory:

touch ~/.hushlogin

Log out and log back in to see the effect. If the .hushlogin file is present, you should no longer see the MOTD, last login information, or other notices.

If you ever want to enable the login message, simply remove the .hushlogin file:

rm ~/.hushlogin

Then log out and log back in to see the login message again.

Leave a Comment

Cancel reply

Your email address will not be published.