232
Displaying or exporting the local host public key
In SSH, to allow your local device to be authenticated by a peer device through digital signature, you
must display or export the local host public key, which will then be specified on the peer device.
To display or export the local host public key, choose one of the following methods:
• Displaying and recording the host public key information
• Displaying the host public key in a specifi
c format and saving it to a file
• Exporting the host public key in a specific format to a file
If
your local device functions to authenticate the peer device, you must specify the peer public key on the
local device. For more information, see "Specifying the peer public key on the local device."
Displaying and recording the host public key information
After you display the host public key, record the key information for manually configuration of the key on
the peer device.
Follow the step to display the local public key:
To do… Use the command…
Remarks
Display the local RSA public keys
display public-key local rsa public
[ | { begin | exclude | include }
regular-expression ]
Required
Available in any view.
Use at least one command.
Display the local host public key
display public-key local dsa public
[ | { begin | exclude | include }
regular-expression ]
NOTE:
The display public-key local rsa public command displays both the RSA server and host public keys.
Recording the RSA host public key is enough.
Displaying the host public key in a specific format and saving it to a file
After you display the host public key in a specify format, save the key to a file, and transfer this file to the
peer device.
Follow these steps to display the local host public key in a specific format:
To do… Use the command…
Remarks
Enter system view system-view —
Display the local RSA host public
key in a specific format
public-key local export rsa
{ openssh | ssh1 | ssh2 }
Required
Use at least one command.
Display the local DSA host public
key in a specific format
public-key local export dsa
{ openssh | ssh2 }
Exporting the host public key in a specific format to a file
After you export and save the host public key in a specify format to a file, transfer the file to the peer
device.
Follow these steps to export and save the local host public key to a file: