public-key peer import sshkey

Use public-key peer import sshkey to import a peer host public key from a public key file.

Use undo public-key peer to remove a peer host public key.


public-key peer keyname import sshkey filename

undo public-key peer keyname


No peer host public keys exist.


System view

Predefined user roles




keyname: Specifies a name for a peer host public key, a case-sensitive string of 1 to 64 characters.

filename: Specifies a public key file by its name, a case-insensitive string of 1 to 128 characters. The name cannot be all dots (.), hostkey, serverkey, dsakey, or ecdsakey, and cannot start with a slash (/) or contain ./ and ../. For more information about file names, see Fundamentals Configuration Guide.

Usage guidelines

After you configure this command, the system automatically transforms the host public key to the PKCS format, and saves the key.

Before you use this command, make sure you have got a copy of the public key file from the peer device through FTP in binary mode or through TFTP.

In non-FIPS mode, the device supports importing public keys in the format of SSH 1.5, SSH 2.0, and OpenSSH.

In FIPS mode, the device supports importing public keys in the format of SSH 2.0 and OpenSSH.


# Import the peer host public key key2 from the public key file

<Sysname> system-view
[Sysname] public-key peer key2 import sshkey

Related commands

display public-key peer

public-key local export dsa

public-key local export ecdsa

public-key local export rsa