1

This is a fresh and clean headless Debian 8.7 system, kernel 3.16.0-4-amd64..

When I log in over SSH, I get that ugly Debian copyright notice:

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

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.

I don't know why that message is being displayed. It's been disabled in /etc/ssh/sshd_config:

PrintMotd no
PrintLastLog yes
TCPKeepAlive yes

It's not being called from ~/.profile or ~/.bashrc. The message is even being displayed before the contents of /etc/profile and /etc/bash.bashrc.

There is not even an /etc/update-motd.d directory, just a static /etc/motd file. Where is this file magically being opened from?

1
  • @Fox Yep, it contains the string Debian GNU/Linux 8 \n \l, but is never actually displayed when I log in.
    – IQAndreas
    Commented Feb 7, 2017 at 18:58

2 Answers 2

9

On Debian-derived systems, even with PrintMotd set to no in the sshd_config, the MOTD is still presented as part of a PAM configuration.

For instance, on my Ubuntu (and thus Debian-derived) system, in my /etc/pam.d/sshd, I see:

# Print the message of the day upon successful login.
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate

Commenting these out may suppress the message you are trying to eliminate.

1

Try touch ~/.hush_login on the remote host to suppress motd and a few other things. Better than tampering with sshd config IMO.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .