YouTube Video
If you would prefer to watch the content of this article, there is a video version available on YouTube below:
Introduction
In this article, I’m going to go through the process of removing the message of the day on Ubuntu 24.04. The message of the day, by default, appears when you login to the CLI on Ubuntu and shows things such as the system information and if there are any updates available to install.
So why would you want to remove the message of the day? For me it’s because on slower systems, such as a Raspberry Pi, the message of the day can take a few seconds to run which can delay me getting something done on that system. On higher performing systems, it’s less of a problem.
Another reason is that you might only want a part of the message of the day to be shown or you want a completely different one that you want to be shown.
Removing the Message of the Day
To get started, first open a terminal emulator application of your choice and SSH to the system you need to remove the message of the day from. If it is the local machine, you don’t need to SSH to it. For example:
Once connected, change directory to /etc/update-motd.d by running the following command:
cd /etc/update-motd.d
Now, list all the files in the directory:
ls -lsa
You will see a collection of files. Each of these are individual parts that make up the message of the day that is shown when you login. You will notice that the permissions each file has is read, write, execute, read, execute and read, execute (aka 755). Only 50-landscape-sysinfo is different, with it having read, write and execute (aka 777) as it is a symlink.
To stop the message of the day appearing at login, simply set the files (minus the 50-landscape file) to not be executable. There are two ways to do this:
sudo chmod 644 *
Or
sudo chmod -x *
Run ls -lsa
again to check that the file permissions have changed. For example:
All the files now no longer have the executable permission set, except for 50-landscape file as that is not modified due to it being a symlink.
Alternatively, if you just want to stop one (or multiple) parts of the message of the day appearing, you can set the file that has that part in to not be executable and leave the rest as executable. For example, show everything except for the number of updates available. In this case, the 90-updates-available file will need to be set to not be executable:
sudo chmod 644 90-updates-available
Or
sudo chmod -x 90-updates-available
Run ls -lsa
again to check that the file permission for 90-updates-available has changed. For example:
To check that it worked, logout by typing exit
and then login again. You should no longer see the message of the day appear. For example (all files were set to not be executable in the below image):
Reverting the Changes
If you want to revert the changes so that the original message of the day is shown at login, you simply need set the files to be executable again.
To do this, first change the directory to /etc/update-motd.d again by running the following command:
cd /etc/update-motd.d
Next, the executable flag needs to be set on the files. There are two ways to do this just as before:
sudo chmod 755 *
Or
sudo chmod +x *
If you need to revert just one file instead of all of them, run one of the following commands. I'll use 90-updates-available as an example again:
sudo chmod 755 90-updates-available
Or
sudo chmod +x 90-updates-available
To check that it worked, logout by typing exit
and then login again. When you log back in, only the updates available will be shown in the message of the day area. For example:
Conclusion
I hope that this article was useful.
Thank you for reading and have a nice day!
Top comments (0)