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:
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.
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.
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.
You can enable or disable banner operation using either the switch’s CLI or an SNMP application. The steps include:
Use show banner motd
to display the current banner status.
Syntax
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: In redundant management, the banner is not seen on the standby module, only the active module. |
|
|
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.
-
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
orssh version 1-or-2
, configuring the banner sets the SSH configuration tossh version 2
and displays the messageWarning: SSH version has been set to v2.
-
If a banner is configured, the switch does not allow configuration with
ssh version 1
orssh version 1-or-2
. Attempting to do so produces the ferror messageBanner has to be disabled first.
. -
If a banner is enabled on the switch, the WebAgent displays
Notice to all users
on the banner page.
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
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.
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."