380
For more information about file names, see
Fundamentals Configuration Guide
. If you do not specify
a file name, this command displays the key on the monitor screen.
Usage guidelines
You can use this command to export a local RSA host public key before distributing it to a peer
device.
To distribute a local RSA host public key to a peer device:
1.
Save the exported local host public key to a file by using one of the following methods:
Use the
public-key local export rsa
[
name
key-name
] {
openssh
|
ssh2
}
command to export the
key, and then copy and paste it to a file.
Use the
public-key local export rsa
[
name
key-name
] {
openssh
|
ssh2
}
filename
command to
export key to a file. You cannot export the key to the folder
pkey
or its subfolders.
2.
Transfer a copy of the file to the peer device, for example, by using FTP in binary mode or TFTP.
For more information about FTP and TFTP, see
Fundamentals Configuration Guide
.
3.
On the peer device, use the
public-key peer import
sshkey
command to import the host
public key from the file.
Choose the correct public key format that is supported on the device where you import the host
public key. In FIPS mode, the device only supports SSH 2.0 and OpenSSH.
Examples
# Export the host public key of the local RSA key pair with the default name in OpenSSH format to
the file
key.pub
.
<Sysname> system-view
[Sysname] public-key local export rsa openssh key.pub
# Display the host public key of the local RSA key pair with the default name in SSH 2.0 format.
<Sysname> system-view
[Sysname] public-key local export rsa ssh2
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-2011/05/12"
AAAAB3NzaC1yc2EAAAADAQABAAAA/gTCyWZyabuCJuJjMeMPQaj/kihDMmEGMrSfddq/b
YcbgM7Buit1AgB3x0dFyTPi85DcCznTW4goPXAKFjuzCbGfj/XOvyvPJilneKJqhPT0xd
mLNloY0dImbwS2kwE71rgg1CQ==
---- END SSH2 PUBLIC KEY ----
# Display the host public key of the local RSA key pair with the default name in OpenSSH format.
<Sysname> system-view
[Sysname] public-key local export rsa openssh
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAAA/gTCyWZyabuCJuJjMeMPQaj/kihDMmEGMrSfddq/b
YcbgM7Buit1AgB3x0dFyTPi85DcCznTW4goPXAKFjuzCbGfj/XOvyvPJilneKJqhPT0xd
mLNloY0dImbwS2kwE71rgg1CQ== rsa-key
# Export the host public key of the local RSA key pair
rsa1
in OpenSSH format to the file
rsa1.pub
.
<Sysname> system-view
[Sysname] public-key local export rsa name rsa1 openssh rsa1.pub
# Display the host public key of the local RSA key pair
rsa1
in SSH 2.0 format.
<Sysname> system-view
[Sysname] public-key local export rsa name rsa1 ssh2
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-2011/05/12"
Содержание FlexNetwork 7500 Series
Страница 350: ...335 Related commands display port security port security enable ...
Страница 379: ...364 Sysname system view Sysname keychain abc mode absolute Sysname keychain abc tcp kind 252 ...
Страница 519: ...504 Related commands display ssh2 algorithm ssh2 algorithm cipher ssh2 algorithm key exchange ssh2 algorithm mac ...