< Home

ntp-service authentication-keyid(System view)

Function

The ntp-service authentication-keyid command sets NTP authentication key.

The undo ntp-service authentication-keyid command removes NTP authentication key.

By default, no authentication key is set.

Format

ntp-service authentication-keyid key-id authentication-mode { md5 | hmac-sha256 } [ cipher ] password-key

undo ntp-service authentication-keyid key-id

Parameters

Parameter Description Value
key-id Specifies the key number. It is an integer ranging from 1 to 4294967295.
authentication-mode md5 Adopts Message-Digest Algorithm 5 (MD5) authentication mode. -
authentication-mode hmac-sha256 Adopts Secure Hash Algorithm 256 (SHA256) authentication mode.
NOTE:
To improve security, you are advised to use the SHA256 algorithm instead of the MD5 algorithm.
-
cipher

Indicates the cipher authentication. You can type in the plain text or the cipher text, and it is displayed as the cipher text when the configuration file is viewed.

-
password-key Indicates that the authentication key, which can be in plain text or in cipher text format.
The keyword is a string of case sensitive characters, spaces supported.
  • The password in plain text mode is a string of 1 to 255 characters.
  • The password in cipher text mode is a string of 20 to 392 characters.
NOTE:

If a password contains a space, the password must be placed into a pair of double quotation marks. Only one pair of double quotation marks can be used for each user name.

To have a secure password, it is recommended that the password-key should be minimum of 8 characters and contain at least two combination of the following:
  • at least a lowercase letter
  • at least a uppercase letter
  • at least a numeral
  • at least a special character including blank space

Views

System view

Default Level

2: Configuration level

Usage Guidelines

NTP supports the MD5 and SHA256 authentication mode.

MD5 is faster than HMAC-SHA256, but is considered less secure.

Example

# Set HMAC-SHA256 authentication key. The key ID number is 10 and the key is Huawei-123.

[sysname] ntp-service authentication-keyid 10 authentication-mode hmac-sha256 Huawei-123
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >