Skip to content

Banners

Banners

Warnings and Welcome Banners

A personalized SSH banner is fun. But also most companies have them. It is easy to do the banner.

To display a welcome or warning message for SSH users before signing in. Use a file like issue.net or sshd-banner to display a warning banner. This is an area often forgotten in system protection, a well-formed banner text. SSH warning banners and welcome messages are necessary when organization wishes to prosecute an unauthorized user or just give out some information or announcement.

SSH Warnings Banner – before Login

Pre-login SSH warning banner shows before the password prompt. It usually uses for legal warnings to establish the terms and conditions by which someone is allowed to use the system.

The SSH warning banners are commonly located in the files /etc/issue and /etc/issue.net, but you can also use your custom file like /etc/ssh/sshd-banner. The content of the specified file is sent to the remote user before authentication.

We need to edit the sshd config file /etc/ssh/sshd_config and add the pre-login banner file of our choice.

Locate #Banner none and replace or append the line with banner /etc/issue.net or /etc/ssh/sshd-banner that line defines the pre-login banner file.

Create the actual Warnings Banner

Start by nano /etc/issue.net, this file can hold anything you like, or you make it as per your organization policy.

       __        ___    ____  _   _ ___ _   _  ____
       \ \      / / \  |  _ \| \ | |_ _| \ | |/ ___|
        \ \ /\ / / _ \ | |_) |  \| || ||  \| | |  _
         \ V  V / ___ \|  _ <| |\  || || |\  | |_| |
          \_/\_/_/   \_|_| \_|_| \_|___|_| \_|\____|

Unauthorized access to this system is forbidden and will be
prosecuted by law. By accessing this system, you agree that 
all your actions may be monitored if unauthorized usage is 
suspected. You have been warned.

###############################################################
#                  _    _           _     _                   #
#                 / \  | | ___ _ __| |_  | |                  #
#                / _ \ | |/ _ \ '__| __  | |                  #
#               / ___ \| |  __/ |  | |_  |_|                  #
#              /_/   \_\_|\___|_|   \__  (_)                  #
#                                                             #
#  You are entering a secured area!                           #
#                                                             #
#  Your IP, Login Time and Username has been noted and        #
#  has been sent to the server administrator!                 #
#                                                             #
#  This service is restricted to authorized users only.       #
#  All activities on this system are logged.                  #
#                                                             #
#  Unauthorized access will be fully investigated and         #
#  reported to the appropriate law enforcement agencies.      #
###############################################################
AND

Restart SSH

service sshd reload

SSH Welcome Message – after Login

The content of the file /etc/motd is displayed after successful authentication, but just before the shell. It is used for system announcements and other important information, that you want authenticated users to know about before they start using the system.

Proxmox Banner

We need to disable the Proxmox Banner otherwise it will update at every reboot the /etc/issue to an unsecure /etc/issue.

sudo systemctl disable pvebanner