Remove the Message of the Day on Ubuntu 24.04
Tags: linux, raspberrypi, ubuntu, webdev
Published: 2024-07-11 11:38:00

- [YouTube Video](#youtube-video)
- [Introduction](#introduction)
- [Removing the Message of the Day](#removing-the-message-of-the-day)
- [Reverting the Changes](#reverting-the-changes)
- [Conclusion](#conclusion)


## YouTube Video

If you would prefer to watch the content of this article, there is a video version available on YouTube below:

{% embed https://www.youtube.com/embed/60IS0eHwLsE?si=7Fc-OouegSVR6pPk %}

## 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:

![00](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lws0g3cimsbeu9bvf1s7.png)

Once connected, change directory to */etc/update-motd.d* by running the following command:

``` bash
cd /etc/update-motd.d
```

Now, list all the files in the directory:

``` bash
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.

![01](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5clajoe7lmz4ams65z0p.png)

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:

``` bash
sudo chmod 644 *
```

Or

``` bash
sudo chmod -x *
```

Run `ls -lsa` again to check that the file permissions have changed. For example:

![02](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xfg6t1yese8wghl7of5.png)

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:

``` bash
sudo chmod 644 90-updates-available
```

Or

``` bash
sudo chmod -x 90-updates-available
```

Run `ls -lsa` again to check that the file permission for *90-updates-available* has changed. For example:

![03](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ql7dsljmk7vb1qudeidt.png)

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

![04](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fkuutez2c9a443msyviy.png)

## 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:

``` bash
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:

``` bash
sudo chmod 755 *
```

Or

``` bash
sudo chmod +x *
```

![05](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqks7tsh5v6dpyues2a2.png)

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:

``` shell
sudo chmod 755 90-updates-available
```

Or

``` shell
sudo chmod +x 90-updates-available
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmex96kpt61dafz2w9ax.png)

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:

![07](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ixol0jjzgsaawtvwlyh.png)

## Conclusion

I hope that this article was useful.

Thank you for reading and have a nice day!