sm2 peer-public-key

Function

The sm2 peer-public-key command displays the SM2 public key view.

The undo sm2 peer-public-key command deletes SM2 public key configuration.

By default, no SM2 public key is configured.

Format

sm2 peer-public-key key-name

undo sm2 peer-public-key key-name

Parameters

Parameter Description Value
key-name

Specifies the name of an SM2 public key.

The value is a string of 1 to 40 case-insensitive characters, spaces not supported. The string can contain only letters, digits, and underscores (_).

Views

System view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
ssh-server write

Usage Guidelines

Usage Scenario

If an SM2 public key is used for authentication, you need to enter the SM2 public key view to edit the public key in the SM2 key pair on the SSH server and generate a new SM2 public key that can be successfully authenticated by the private key in the SM2 key pair. This public key can be bound to an SSH user or client as a credential for server login.

Implementation Procedure

To configure an SM2 public key, perform the following steps:

  • Run the sm2 peer-public-key command to enter the SM2 public key view.
  • Run the public-key-code begin command to start editing.
  • Copy and paste the public key in the SM2 key pair on the SSH server.
  • Run the public-key-code end command to exit the SM2 public key edit view.
  • Run the peer-public-key end command to exit the SM2 public key edit view and return to the system view.

Precautions

To delete SM2 public key configuration from a device after assigning an SM2 public key to an SSH user, run the undo ssh user assign sm2-key command to delete the mapping between the SM2 public key and SSH user. Otherwise, the SM2 public key configuration cannot be deleted using the undo sm2 peer-public-key command.

The public key on the client is randomly generated by client software.

A maximum of 20 SM2 public keys can be configured.

Example

# Display the SM2 public key view.
<HUAWEI> system-view
[~HUAWEI] sm2 peer-public-key sm2key001
Enter "SM2 public key" view, return system view with "peer-public-key end".
[*HUAWEI-sm2-public-key] public-key-code begin
Enter "SM2 public key" view, return system view with "peer-public-key end".
[*HUAWEI-sm2-public-key-sm2-key-code] 0474F110 F90F131B B6F6D929 9A23A41E F1AB1666
[*HUAWEI-sm2-public-key-sm2-key-code] AC4BE4EE EF2CD876 2B633F80 DD5CF42F 147A722F
[*HUAWEI-sm2-public-key-sm2-key-code] DE527F39 247F3744 C23296BE FE3BE502 EEF7D9EC
[*HUAWEI-sm2-public-key-sm2-key-code] BC28A576 7E
[*HUAWEI-sm2-public-key-sm2-key-code] public-key-code end
[*HUAWEI-sm2-public-key] peer-public-key end
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >