Create user ssh on Huawei Switch
In Huawei Switch by default, no ssh user is created. The ssh user command creates an SSH user. The undo ssh user command deletes an SSH user.
You can create a user using either of the following methods:
- Run the ssh user command.
- After the ssh user authentication-type, ssh user service-type, and ssh user sftp-directory command are run, the system automatically create a user named user-name if the system detects that the user named user-name does not exist.
<HUAWEI> system-view
[~HUAWEI] ssh user testuser
By default, no authentication mode is configured for an SSH user. The ssh user authentication-type command configures the authentication mode for an SSH user. The undo ssh user authentication-type command deletes the configured authentication mode.
Format
ssh user user-name authentication-type { password | rsa | password-rsa | dsa | password-dsa | ecc | password-ecc | x509v3-rsa | password-x509v3-rsa | all | sm2 | password-sm2 }
undo ssh user user-name authentication-type
Example
# Set the authentication mode to password authentication for the SSH user john.
<HUAWEI> system-view
[~HUAWEI] ssh user john authentication-type password
# Set the authentication mode to ECC authentication for the SSH user ssh_user1@dom1.
<HUAWEI> system-view
[~HUAWEI] ssh user ssh_user1@dom1 authentication-type ecc
# Set the authentication mode to x509v3-ssh-rsa for the SSH user ssh_user1@dom1
<HUAWEI> system-view
[~HUAWEI] ssh user ssh_user1@dom1 authentication-type x509v3-rsa
By default, no service type is configured for an SSH user. The ssh user service-type command configures the service type for an SSH user. The undo ssh user service-type command restores the default service type for an SSH user.
Format
ssh user user-name service-type { { sftp | stelnet | snetconf } * | all }
undo ssh user user-name service-type
Example
# Configure the service type for SSH users.
<HUAWEI> system-view
[~HUAWEI] ssh user john service-type all