1-11 
 
This configuration task is unnecessary if the SSH user’s authentication mode is password. 
 
For the publickey authentication mode, you must specify the client’s public key on the server for 
authentication. 
Table 1-10 Follow these steps to assign a public key for an SSH user: 
To do...  Use the command...  Remarks 
Enter system view 
system-view 
—
 
Assign a public key to an SSH 
user 
ssh user username assign 
publickey keyname  
Required 
If you issue this command 
multiple times, the last 
command overrides the 
previous ones. 
 
Exporting the RSA or DSA Public Key 
You can display the generated RSA or DSA public key on the screen in a specified format or export it to 
a specified file, so that you can configure the key at a remote end when necessary. 
Table 1-11 Follow these steps to export the RSA public key: 
To do...  Use the command...  Remarks 
Enter system view 
system-view 
— 
Display the RSA key on the screen in a 
specified format or export it to a 
specified file 
public-key local export rsa 
{ openssh | ssh1 | ssh2 } 
[ filename ] 
Required 
 
Table 1-12 Follow these steps to export the DSA public key: 
To do...  Use the command...  Remarks 
Enter system view 
system-view 
— 
Display the DSA key on the screen in 
a specified format or export it to a 
specified file 
public-key local export dsa 
{ openssh | ssh2 } [ filename ] 
Required 
 
 
The DSA public key format can be SSH2 and OpenSSH, while the RSA public key format can be SSH1, 
SSH2 and OpenSSH.