The header command configures the header information displayed on a terminal when users log in to a connected device.
The undo header command deletes the header information displayed on a terminal when users log in to a connected device.
By default, no header information is displayed on terminals when users log in to a connected device.
Parameter | Description | Value |
---|---|---|
login |
Indicates header information displayed on a terminal when a user logs in to the device and a connection between the terminal and the device is activated. |
- |
shell |
Indicates the header displayed on a terminal when the session is set up after the user logs in to the connected device. |
- |
information text |
Specifies the header and content. |
The value is a string with spaces and carriage returns supported. The maximum length of the string that can be entered at one time is 480 characters. |
file file-name |
Specifies the file name that the header uses. |
The value is a string of 1 to 64 characters without spaces. Only the absolute path is supported. The file name must be in the [drive] [path] [file name] format, where [path] is the absolute path of the file. The maximum header file size that can be configured is 2 KB. |
Usage Scenario
To provide some prompts or alarms to users, run the header command to configure a title on the device. If a user logs in to the device, the title is displayed.
Procedure
If information is specified, the header text starts and ends with the same character. You can set the header text in either of the following modes:
Non-interactive: enter the header text behind the start character.
Use the same character at the beginning and end of the header and press Enter. If the start and end characters are inconsistent, the system prompts an error message.
Interactive: enter the start character and press Enter to enter the interactive process.
The system displays a message asking you to enter the correct header information. After you enter the information, enter the same character as the start character. Press Enter. The system quits the interactive process.
During interaction, you can press Enter at any time to enter information in the next line.
Precautions
# Configure a shell header in non-interactive mode.
<HUAWEI> system-view
[HUAWEI] header shell information &Hello! Welcome to system!& # Enter the header text behind the start character '&' and enter '&' at the end of the header text, and press Enter.
# Display the shell header if the login succeeds.
Hello! Welcome to system!
# Configure a shell header in interactive mode.
<HUAWEI> system-view
[HUAWEI] header shell information % # Press Enter after entering the start character '%' to start the interactive process.
The banner text supports 480 characters max, including the start and the end cha
racter.If you want to enter more than this, use banner file instead.Input banner
text, and quit with the character '%':
Hello!
Welcome to system!% # Press Enter after entering the end character '%' to quit the interactive process.
[HUAWEI] quit
<HUAWEI> quit // Log off.
# Press Enter. The shell header is displayed when the user logs in again.
Hello!
Welcome to system!
<HUAWEI>
# Specify the file that stores a login header.
<HUAWEI> system-view [HUAWEI] header login file flash:/header-file.txt