ssh user assign
Function
The ssh user assign command assigns an existing public key to a user.
The undo ssh user assign command deletes the mapping between the user and public key.
By default, no public key is assigned to a user.
Format
ssh user user-name assign { rsa-key | ecc-key } key-name
undo ssh user user-name assign { rsa-key | ecc-key }
Parameters
Parameter | Description | Value |
---|---|---|
user-name | Specifies the SSH user name. | The value is a string of 1 to 64 case-insensitive characters without spaces. |
rsa-key | Specifies the RSA public key. | - |
ecc-key | Specifies the ECC public key. | - |
key-name | Specifies the client public key name. | The value is a string of 1 to 30 characters. |
Usage Guidelines
Usage Scenario
When an SSH client needs to log in to the SSH server in RSA mode, run this command to assign a public key to the client. If the client has been assigned keys, the latest assigned key takes effect.
Precautions
The newly configured public key takes effect upon next login.
If the user named user-name to whom a public key is assigned does not exist, the system automatically creates an SSH user named user-name and performs the configured authentication for the SSH user.