Categories: LinuxUbuntu

How to Display a Welcome Message after SSH Login on Ubuntu

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

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.

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

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

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

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:

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

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

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.

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago