The rsa local-key-pair create command generates local RSA host and server key pairs.
The rsa local-key-pair destroy command removes all local RSA keys including the host key pair and the server key pair.
By default, no local RSA host or server key pairs are generated.
Usage Scenario
To generate local RSA host and server key pairs, run the rsa local-key-pair create command. After the command is run, if an RSA key exists, the system prompts you to confirm whether to change the original key. The generated key pair is named device name_server and device name_host, such as HUAWEI_host and HUAWEI_server. This command is not saved in the configuration file.
After inputting the rsa local-key-pair destroy command, you should confirm whether to remove all local RSA keys. After the rsa local-key-pair destroy command is run, it takes effect and is not saved in the configuration file.
Precautions
To ensure that the local key pair is not changed after the system restarts, run the save command to save the configuration file. Otherwise, the system generates a new local key pair after it restarts. You need to use the new local key pair to log in to the device through SSH.
<HUAWEI> system-view [~HUAWEI] rsa local-key-pair create The key name will be:HUAWEI_Host The range of public key size is (2048, 4096). NOTE: Key pair generation will take a short while. Please input the modulus [default = 3072]:3072
<HUAWEI> system-view [~HUAWEI] rsa local-key-pair destroy The name for the keys which will be destroyed is HUAWEI_Host. Confirm to destroy these keys? Please select [Y/N]: Y