Ubuntu remove SSH welcome message

When you login to an Ubuntu server using SSH, you get welcome message like

Ubuntu welcome message

On most Linux systems, this is generated by /etc/motd. On Ubuntu, MOTD (message of the day) generated dynamically with some scripts. I don’t want to see all the marketing message from Ubuntu everyday.

To disable MOTD on Ubuntu, just delete the scripts from /etc/update-motd.d/

Advertisement

rm -f /etc/update-motd.d/*

If you want a differnt motd, you can put a shell script in this folder.

Method 2

Another way to disable motd is by disabling pam_motd.so module.

Edit files

/etc/pam.d/login
/etc/pam.d/sshd

Comment out the lines related to pam_motd.so

session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement