Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

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 192.168.1.19

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

Comments