Login banners

Custom login banners

You can configure the switch to display a login banner of up to 3070 characters. An operator initiates a management session with the switch through any of the following methods:

  • Telnet

  • Serial connection

  • SSHv2

  • WebAgent

The default banner displays product registration information; the copyright splash is no longer displayed.

If a banner is configured, the banner page is displayed when you access the WebAgent. The default product registration information is not displayed as there is already a product registration prompt displayed in the WebAgent.

Banner operation with telnet, serial, or SSHv2 access

When a system operator begins a login session, the switch displays the banner above the prompts for local password and Press any key to continue. Entering a correct password or, if no password is configured, pressing any key clears the banner from the CLI and displays the CLI prompt.

Banner operation with the WebAgent

When a system operator uses the WebAgent to access the switch, the text of a non-default banner configured on the switch appears in a dedicated banner window with a link to the next page. Click Continue to display either the Registration page or the switch’s home page. If the banner feature is disabled or if the switch is using the factory-default banner, then the banner page does not appear in the WebAgent screen when an operator initiates a login session with the switch.

Configuring and displaying a non-default banner

You can enable or disable banner operation using either the switch’s CLI or an SNMP application. The steps include:

  1. Enable non-default banner operation and define the endpoint delimiter for the banner.

  2. Type the desired banner text, including line breaks.

  3. Type the endpoint delimiter.

Use show banner motd to display the current banner status.

Syntax

banner motd <delimiter>

no banner motd

This command defines the single character used to terminate the banner text and enables banner text input. You can use any character except a blank space as a delimiter. The no form of the command disables the login banner feature.

<banner-text-string>

The switch allows up to 3070 banner characters, including blank spaces and CR-LF ([Enter]). (The tilde “~“ and the delimiter defined by banner motd <delimiter> are not allowed as part of the banner text.) While entering banner text, you can backspace to edit the current line (that is, a line that has not been terminated by a CR-LF.) However, terminating a line in a banner by entering a CR-LF prevents any further editing of that line. To edit a line in a banner entry after terminating the line with a CR-LF requires entering the delimiter described above and then re-configuring new banner text.


[NOTE: ]

NOTE: In redundant management, the banner is not seen on the standby module, only the active module.


Configuring and displaying a banner

The following banner can be configured on your switch.

            This is a private system maintained by the

                    Allied Widget Corporation

           Unauthorized use of this system can result in

                  civil and criminal penalties!

Use the Enter key to create line breaks, blank spaces for line centering, and the % symbol to terminate the banner message.

Configuring a login banner

HP Switch(config)# banner motd %

Enter TEXT message. End with the character'%'

This is a private system maintained by the
        Allied Widget Corporation.
  Unauthorized use of this system can result in
        civil and criminal penalties!%
HP Switch(config)# write memory

To view the current banner configuration, use either the show banner motd or show running command.

Show banner motd output

HP Switch(config)# show banner motd
Banner Information
Configured Banner:

     This is a private system maintained by the
            Allied Widget Corporation.
   Unauthorized use of this system can result in
          civil and criminal penalties!

Banner in the switch’s running-config file

HP Switch (config)# show running

Running configuration:

; J8697A Configuration Editor; Created on release #K.15.12.0001
; Ver #01:01:00

hostname "HP Switch"
module 1 type J8702A
vlan 1
  name "DEFAULT_VLAN"
  untagged A1-A24
  ip address dhcp-bootp
  exit
banner motd "This is a private system maintained by the\n Allied Widget
Corporation.\nUnauthorized use of this system can result in\n civil and
criminal penalties!"
password manager

HP Switch (config)#

The next time someone logs onto the management CLI, the login screen displays the configured banner. Entering a correct password clears the banner and displays the CLI prompt.

CLI result of the login banner configuration

              This is a private system maintained by the 
                       Allied Widget Corporation. 
             Unauthorized use of this system can result in
                       civil and criminal penalties!

Operating notes

  • The default banner appears only when the switch is in the factory default configuration. Using the command no banner motd deletes the currently configured banner text and blocks display of the default banner. The default banner is restored only if the switch is reset to its factory-default configuration.

  • The switch supports one banner at any time. Configuring a new banner replaces any former banner configured on the switch.

  • If the switch is configured with ssh version 1 or ssh version 1-or-2, configuring the banner sets the SSH configuration to ssh version 2 and displays the message Warning: SSH version has been set to v2.

  • If a banner is configured, the switch does not allow configuration with ssh version 1 or ssh version 1-or-2. Attempting to do so produces the ferror message Banner has to be disabled first..

  • If a banner is enabled on the switch, the WebAgent displays Notice to all users on the banner page.

User-configurable banner message after authentication

A text message that has been configured with the banner motd command displays with the authentication prompt when a user opens a console, telnet, SSH, or WebAgent session.

The exec option of the banner command displays a user-configurable message after the user has been authenticated. If there is no password on the switch, the exec banner message displays immediately.

Syntax

[no] banner exec <ASCII-string>

Sets the exec banner text. Text can be multiple lines up to 3070 characters, and can consist of any printable character except the tilde (~) and the delimiting character.

<ASCII-string>

The text must end with a delimiting character, which can be any single character except the tilde (~) character.

The [no] version of the command removes the banner exec text.

The banner exec command

HP Switch(config)# banner exec &

Enter TEXT message. End with the character &

This is Switch A in the language lab &

Use the show banner exec command to display the status and text for the exec banner configuration.

Displaying banner exec configuration

HP Switch(config)# show banner exec

Banner Information

Banner Status: Enabled
Configured Banner:

This is Switch A in the language lab

banner motd command with non-interactive mode

The use of escape characters allows the banner motd command to be used in non-interactive mode for multiple message lines. In non-interactive mode, you can create a banner message enclosed in double quotes or other delimiter that uses escape characters within the delimiters. Other existing CLI commands do not support the escape characters. For more information on interactive and non-interactive mode, see CLI interactive commands in this guide.

Supported escape characters

Character Description
\" double quote
\’ single quote
\` forward quote
\\ backslash
\f form feed
\n newline
\r carriage return
\t horizontal tab
\v vertical tab

Configuring the banner message using escape characters within double quote delimiters

HP Switch(config)# banner motd 
"You can use the \’banner motd\’ CLI command in non-interactive mode.\n\n\tThe banner
motd command will support escape characters."

HP Switch(config)# show banner motd

Banner Information

Banner status: Enabled

Configured Banner:

You can use the ‘banner motd’ CLI command in non-interactive mode.

     The banner motd command will support escape characters."

The running config file with banner motd configured in non-interactive mode

HP Switch(config)# show running-config

Running configuration:

;J8693A Configuration Editor; Created on release #K.15.10.0002
;Ver #01:01:00

hostname "HP Switch"
vlan 1
  name "DEFAULT_VLAN"
  untagged 1-48, a1-a4
  ip address dhcp-bootp
  exit
banner motd "You can use the \’banner motd\’ CLI command in
non-interactive mode.\n\n\tThe banner motd command will support
escape characters."

Configuring the banner message using an alternate delimiter of ‘#’

HP Switch(config)# banner motd #

Enter TEXT message.

End with the character ‘#’.

You can use the banner motd CLI command in non-interactive mode. The banner motd command \n\n\t will support escape characters #.