As we all know, we can type banner in /etc/motd
or in the file /etc/issue.net
,
so every user that login to the Linux machine will get the banner message, for example:
Red Hat Enterprise Linux Server release 6.8 (Santiago)
Kernel \r on an \m
##########################################################################
# Welcome to OBAMA house !!!
# All connections are monitored and recorded
# Disconnect IMMEDIATELY if you are not an authorized user!
#
##########################################################################
The problem is that the banner is displayed also when we login remotely via ssh
to the Linux machines (as opposed to login locally).
We can simply ignore the banner in the ssh by using the flag -q
as the following:
ssh -q 192.19.23.45 ls /hillary_emails
In fact we have more then ~100 Bash and Perl scripts that use ssh
,
so if we add banners to all the machines we need to change also the scripts that use the ssh
command, by adding the flag -q
(silent mode).
We prefer not to edit the scripts, due to internal reasons.
So my question is,
is it possible to change the Linux client configuration in a way the banner will display only on local logins, and not display when login remotely by ssh
?