How to Hide the SSH Welcome Message on Ubuntu

Written by ryan256 | Published 2023/10/20
Tech Story Tags: ssh | ubuntu | server | welcome-message-on-ubuntu | how-to-hide-ubuntu-ssh-message | remote-ubuntu-server-tips | ubuntu-ssh-welcome-screen | ubuntu-guide

TLDRUsers typically encounter this screen when connecting to a server operating on Ubuntu or any Debian-based distribution. 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.via the TL;DR App

When accessing your remote Ubuntu 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.

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.

How to Hide SSH Welcome Message on Ubuntu

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.

To suppress a welcome message, begin by opening your terminal and modifying the /etc/ssh/sshd_config file with your preferred text editor.

$ sudo vim /etc/ssh/sshd_config

Once the file is opened, find the PrintMotd field and set its value to no.

Save and close the file, then proceed to edit the /etc/pam.d/sshd file.

$ sudo vim /etc/pam.d/sshd

Then find the following two lines:

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

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:

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

$ sudo systemctl restart ssh

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:

Also published here.


Written by ryan256 | Passionate tech writer decoding the complexities of the digital world one byte at a time.
Published by HackerNoon on 2023/10/20