258
Distributing a local host public key
For applications such as SSH, you must distribute a local host public key to a peer device so the peer
device can perform the following operations:
• Use the public key to encrypt information sent to the local device.
• Authenticate the digital signature signed by the local device.
To distribute a local host public key, you must first export or display the key.
• Export a host public key:
{ Export a host public key to a file.
{ Export a host public key to the monitor screen, and then save it to a file.
After the key is exported to a file, transfer the file to the peer device. On the peer device, import
the key from the file.
• Display a host public key.
After the key is displayed, record the key, for example, copy it to an unformatted file. On the
peer device, you must literally enter the key.
Exporting a host public key
When you export a host public key, follow these restrictions and guidelines:
• If you specify a file name in the command, the command exports the key to the specified file.
• If you do not specify a file name, the command exports the key to the monitor screen. You must
manually save the exported key to a file.
To export a local host public key:
Step Command
1. Enter system view.
system-view
2. Export a local host public
key.
• Export an RSA host public key:
{ In non-FIPS mode:
public-key local export rsa [ name key-name ] { openssh |
ssh1 | ssh2 } [ filename ]
{ In FIPS mode:
public-key local export rsa [ name key-name ] { openssh |
ssh2 } [ filename ]
• Export an ECDSA host public key:
public-key local export ecdsa [ name key-name ] { openssh |
ssh2 } [ filename ]
• Export a DSA host public key:
public-key local export dsa [ name key-name ] { openssh |
ssh2 } [ filename ]
Displaying a host public key
Perform the following tasks in any view:
Task Command
Display local RSA public keys.
display
public-key
local
rsa
public
[
name
key-name ]
Display local ECDSA public keys.
display public-key local ecdsa public
[
name
key-name ]