Hide debian-style motd

If you use Debian-family systems in a networked environment and log in through ssh, you might see this message a lot:

Linux d2-03a 5.5.0-2-amd64 #1 SMP Debian 5.5.17-1 (2020-04-15) x86_64

The programs included with the Devuan GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Devuan GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed May  6 19:12:04 2020 from

I finally decided to do something about this message that I see every time.
Find any lines in /etc/pam.d/sshd that are uncommented and that call pam_motd.so, and comment the line out.

sudo sed -i -r -e '/pam_motd.so/{/^#/!{s/^/#/;};}' /etc/pam.d/sshd

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.