< Home

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 | dsa-key | ecc-key } key-name

undo ssh user user-name assign { rsa-key | dsa-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.
NOTE:

The string can contain spaces if it is enclosed with double quotation marks (").

rsa-key Specifies an RSA public key. -
dsa-key Specifies a DSA public key. -
ecc-key Specifies an ECC public key. -
key-name Specifies the client public key name. The value is a string of 1 to 30 characters.

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

When an SSH client needs to log in to the SSH server in RSA, DSA, or ECC mode, run the ssh user assign 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 device automatically creates an SSH user named user-name and performs the configured authentication for the SSH user.

To improve security, it is not recommended that you use RSA or DSA as the authentication algorithm.

Example

# Assign key1 to the user named John.

<HUAWEI> system-view
[HUAWEI] ssh user john assign rsa-key key1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >