< Home

header

Function

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.

Format

header { login | shell } { information text | file file-name }

undo header { login | shell }

Parameters

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.

Views

System view

Default Level

3: Management level

Usage Guidelines

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

  • Before setting the login parameter, you must set login authentication parameters; otherwise, no header information about authentication is displayed.
  • Before setting the file parameter, ensure that the file containing the header exists; otherwise, the file name cannot be obtained. If you change header information after login, the header information that has been displayed in the system does not change, even if you exit and log in to the system again. The header information changes in either of the following cases:
    • You have successfully changed the header information. Before the system restarts, you run this command again. Then you exit and log in to the system again.
    • You have successfully changed the header information. Then you restart the system.
  • If you use SSH1.X to log in to the device, only the shell header is displayed.
  • If you use SSH2.0 to log in to the device, both login and shell headers are displayed in the login process.
  • If the header command is configured several times, only the latest configuration takes effect.
  • After configuring the login header, any user that logs in to the system can view the header.
  • In the system view, run the execute batch-filename batch processing command. If the batch processing command contains the header { login | shell } information text command and text contains line feed character \r\n, you need to use third-party software to change the hexadecimal value (0D 0A) of the line feed character \r\n to (1B 19).

Example

# 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >