paint-brush
How to Hide the SSH Welcome Message on Ubuntuby@ryan256
5,357 reads
5,357 reads

How to Hide the SSH Welcome Message on Ubuntu

by Ryan EltonOctober 20th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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.
featured image - How to Hide the SSH Welcome Message on Ubuntu
Ryan Elton HackerNoon profile picture

When accessing your remote Ubuntu server via SSH login, you are greeted by the following SSH welcome screen: Ubuntu 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.

PrintMotd Field


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:

Result

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:

Success


Also published here.