How to Hide SSH Welcome Message on Ubuntu Linux

Table of Contents

Hide SSH Welcome Message on Ubuntu Linux

When accessing your remote Ubuntu Linux server via SSH login, you are greeted by the following SSH welcome screen. Users typically encounter this screen when connecting to a server operating on Ubuntu or any Debian-based distribution.

How to Hide SSH Welcome Message on Ubuntu Linux

Having it initially is fine, but dealing with a lengthy SSH welcome text every server connection eventually becomes bothersome. In this guide, you’ll discover how to turn off the SSH welcome message on your Ubuntu system.

The SSH welcome message are shown from the files located at /etc/update-motd.d/ path and settings defined in the /etc/ssh/sshd_config file.

How to Hide SSH Welcome Message on Ubuntu Linux

1. To suppress a welcome message, begin by opening your terminal and modifying the /etc/ssh/sshd_config file with your preferred text editor if the below settings is configured to yes.

cat /etc/ssh/sshd_config | grep PrintMotd
How to Hide SSH Welcome Message on Ubuntu Linux

2. Next, proceed to edit the /etc/pam.d/sshd file.

sudo nano /etc/pam.d/sshd

3. Then find the following two lines:

...
session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate
...

4. Once you locate them, comment them down by placing # in front of each line, as shown:

...
#session    optional     pam_motd.so  motd=/run/motd.dynamic
#session    optional     pam_motd.so noupdate
...

The following is the look of the file after commenting on the above two lines:

How to Hide SSH Welcome Message on Ubuntu Linux

5. Save and close the file, restart your SSH server by running the following command:

sudo systemctl restart ssh

6. After completing the task, attempt to connect to your remote server, and you’ll notice that this time you won’t receive a welcome message, as shown:

How to Hide SSH Welcome Message on Ubuntu Linux

Leave a Comment

Required fields are marked *