How to Disable the SSH MOTD on Ubuntu

When you log into a Ubuntu server via SSH, you might notice a welcome message displaying system information like updates, disk usage, and system load. This is known as the Message of the Day (MOTD). While this information can be useful, there are situations where you might want to disable it, such as for a cleaner login experience or security reasons. In this blog post, we’ll walk you through the steps to disable the SSH MOTD welcome message on Ubuntu Linux.

Understanding the MOTD System

Ubuntu’s MOTD system is a combination of static and dynamic content. Static content comes from the /etc/motd file, while dynamic content is generated by scripts in the /etc/update-motd.d/ directory.

When a user logs in, these scripts are executed, and their output is concatenated to form the MOTD. The dynamic MOTD often includes information such as system updates, reboot notifications, and resource usage.

Disabling the MOTD Message

How to disable the Linux login banner

1. Install the Update-MOTD

sudo apt install update-motd

2. Make the scripts non-executable:

You can change the permissions of these scripts so they won’t run:

sudo chmod -x /etc/update-motd.d/*

3. Disable the MOTD

sudo update-motd --disable

Disable the SSH Login Banner

Verifying the Changes

To verify that the MOTD message is disabled, log out and log back in via SSH. You should no longer see the MOTD message.

MOTD message is disabled

Conclusion

This is the way how to Disable the SSH MOTD welcome message on Ubuntu Linux can provide a cleaner login experience and reduce unnecessary information displayed to users. This guide covers how to disable both static and dynamic MOTD content. Always consider the implications of these changes, especially in a multi-user environment or where MOTD provides critical information.

Feel free to share your experiences or ask questions in the comments below!

Tagged:

Leave a Reply

Your email address will not be published. Required fields are marked *