[root@testsvr01 ~]# cat << EOF > /etc/ssh/sshd-banner #############################################################################

 

         ACCESS WARNING: THIS IS Learns to Win NETWORK
         *********************************************************

  Unauthorized access to this device or the attached networks is prohibited
  without express written permission. Violators will be prosecuted to the
  fullest extend of both civil and criminal law.

  This system is for the use of authorized users only.

#############################################################################
EOF

 

  • Add Banner File in  /etc/ssh/sshd_config File & Restart

[root@testsvr01 ~]# cat  /etc/ssh/sshd_config | grep Banner
#Banner none
Banner /etc/ssh/sshd-banner
[root@testsvr01 ~]# service sshd reload
Redirecting to /bin/systemctl reload sshd.service

  • Connect Server for Client

[root@testclient1 ~]# ssh testsvr01
Pre-authentication banner message from server:
 #############################################################################

         ACCESS WARNING: THIS IS Learns to Win NETWORK
          *********************************************************

   Unauthorized access to this device or the attached networks is prohibited
   without express written permission. Violators will be prosecuted to the
   fullest extend of both civil and criminal law.

   This system is for the use of authorized users only.

 #############################################################################
End of banner message from server
root@testsvr01's password:
[root@testsvr01 ~]#