display ssh client server-public-key

Use display ssh client server-public-key to display server public key information saved in the public key file of the SSH client.

Syntax

display ssh client server-public-key [ server-ip ip-address ]

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Parameters

server-ip ip-address: Specifies the IP address of the server whose public key information will be displayed. If you do not specify a server IP address, this command displays the public keys of all servers saved in the client's public key file.

Usage guidelines

When a user connects to an unauthenticated server and selects to save the server's public key, the server public key will be saved to the public key file. Server public key information saved in the public key file is not available in the configuration file. To display such server public key information on the SSH client, you must use this command.

Examples

# Display all server public keys saved in the public key file of the SSH client.

<Sysname> display ssh client server-public-key
 Server address: 10.153.124.209
 Key type: ecdsa-sha2-nistp256
 Key length: 256
 Key code:
   AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAOGpJfwJExK
   eYb53KKqmrZ0V/XnYZKZEchyN9ax1IBt+toIXHeW5NfBE5ymeklPSNgQNhcndkU/
   422fT15UmgM=

 Server address: 2.2.2.1
 Key type: rsa
 Key length: 1024
 Key code:
   AAAAB3NzaC1yc2EAAAADAQABAAAAgQDIUrHbeLx/W7xElB1Ny3zeA8/uV9K6sj1p
   dSlhx5XcOatdNMoD/sioYgSsy9IxKZPqBs+vadqx/wCCB5+T2GLLu2qgaT0P9J+v
   RR/9Y8fI2b4tS7PoNf/QKDVD7XnoiZ+dqd0tnnRf6GV+74cp8ZEUQdAoTeDzzaAh
   7t6FbxrNrQ==

# Display the public key of server 2.2.2.1 saved in the public key file of the SSH client.

<Sysname> display ssh client server-public-key server-ip 2.2.2.1
 Server address: 2.2.2.1
 Key type: rsa
 Key length: 1024
 Key code:
   AAAAB3NzaC1yc2EAAAADAQABAAAAgQDIUrHbeLx/W7xElB1Ny3zeA8/uV9K6sj1p
   dSlhx5XcOatdNMoD/sioYgSsy9IxKZPqBs+vadqx/wCCB5+T2GLLu2qgaT0P9J+v
   RR/9Y8fI2b4tS7PoNf/QKDVD7XnoiZ+dqd0tnnRf6GV+74cp8ZEUQdAoTeDzzaAh
   7t6FbxrNrQ==

Table 58: Command output

Field

Description

Server address

IP address of the SSH server.

Key type

Type of the public key:

  • dsa—DSA public key.

  • ecdsa-sha2-nistp256—256-bit ECDSA public key created by using the secp256r1 curve.

  • ecdsa-sha2-nistp384—384-bit ECDSA public key created by using the secp384r1 curve.

  • rsa—RSA public key.

Key length

Length of the public key, in bits.

Key code

Content of the public key.