At times when you want to provide remote access to your system via SSH, you want a customized message to be displayed on the terminal for the remotely logged-in user. This message is often called the message of the day. In this tutorial, I will show you how to show a custom text message on SSH login on your Linux server. I have used Ubuntu 20.04 for this tutorial, but the same steps should work on other Linux distributions too.

Pre-Requisites

You need to have SSH installed.

Displaying a Message of the Day on Ubuntu

For displaying the message of the day in Linux, you will have to perform the following steps:

Step # 1: Create a Message of the Day File

First, you need to create a message of the day or MOTD file on your system with the command shown below:

$ sudo nano /etc/motd

How to Display a Welcome Message after SSH Login on Ubuntu linux ubuntu

Once this file is created, you can type in any message of your choice just like we did. After that, you can save this file and exit from your respective text editor.

How to Display a Welcome Message after SSH Login on Ubuntu linux ubuntu

Step # 2: Check the IP Address of your System

The second step is to check the IP address of your system that you can simply do this by executing the following command:

$ ip a

How to Display a Welcome Message after SSH Login on Ubuntu linux ubuntu

The IP address of our Linux system is highlighted in the image shown below:

How to Display a Welcome Message after SSH Login on Ubuntu linux ubuntu

Step # 3: Log into your Machine through SSH to Display the Message of the Day:

Now, you need to log into your machine through SSH by executing the following command. You can either run this command on your own machine’s terminal or you can even use any other machine on the same network for serving the very same purpose.

$ ssh 10.0.2.15

How to Display a Welcome Message after SSH Login on Ubuntu linux ubuntu Advertisement

Since we have executed this command for the very first time, therefore, we have been asked for confirmation which we can provide by typing in “yes” as highlighted in the image shown below:

How to Display a Welcome Message after SSH Login on Ubuntu linux ubuntu

After that, we were asked to enter the password of our Linux Mint 20 system as shown in the following image:

How to Display a Welcome Message after SSH Login on Ubuntu linux ubuntu

Once we had provided our password, the message of the day was displayed on our terminal as highlighted in the image shown below:

How to Display a Welcome Message after SSH Login on Ubuntu linux ubuntu

Conclusion

This is how you can easily create a customized message file on your Ubuntu system to display a message of the day of your choice whenever a user remotely logs into your system through SSH.