How can I disable/modify the SSH login banner for a given user?

How can I disable/modify the SSH login banner for a given user?

enter image description here


It seems it is possible to disable this message on a user basis by creating an empty file in a user's $HOME directory (/home/username/) called .hushlogin.

touch ~/.hushlogin

If you want to disable that message for all ssh users, edit /etc/pam.d/sshd and comment out the lines

session    optional     pam_motd.so  motd=/run/motd.dynamic noupdate
session    optional     pam_motd.so # [1]

In /etc/ssh/sshd_config make sure there is a line:

PrintMotd no

If it is set to 'yes' change it to 'no'.

Restart the SSH server by typing

service ssh restart

You should be good to go from there.


.hushlogin didn't do the trick for me (on Debian 7), but setting Banner to /dev/null in /etc/ssh/sshd_config :

#Banner /etc/issue.net
Banner /dev/null

It is also possible to disable banner using client-side only solution, that is by setting log level to error:

ssh -o LogLevel=Error <rest of cmd>

Found here: http://www.linuxquestions.org/questions/linux-security-4/how-do-you-turn-off-login-banner-for-non-interactive-ssh-470516/