AAA authentication is used as an example. Set the user name to admin123 and password to Huawei@123.
# Generate a local key pair on the server.
<HUAWEI> system-view [HUAWEI] dsa local-key-pair create Info: The key name will be: HUAWEI_Host_DSA. Info: The key modulus can be any one of the following : 512, 1024, 2048. Info: If the key modulus is greater than 512, it may take a few minutes. Please input the modulus [default=2048]: Info: Generating keys... Info: Succeeded in creating the DSA host keys.
# Configure VTY user interfaces on the device.
[HUAWEI] user-interface vty 0 4 [HUAWEI-ui-vty0-4] authentication-mode aaa [HUAWEI-ui-vty0-4] protocol inbound ssh [HUAWEI-ui-vty0-4] quit
If the protocol supported by VTY user interfaces 0 to 4 is changed from Telnet to SSH, users cannot log in to the device using Telnet after logout. In this case, configure VTY user interfaces 0 to 4 to support all protocols first. Configure STelnet and then run the protocol inbound ssh command to configure VTY user interfaces 0 to 4 to support SSH.
# Create an SSH user named admin123 and configure the password authentication mode for the user.
[HUAWEI] aaa [HUAWEI-aaa] local-user admin123 password irreversible-cipher Huawei@123 [HUAWEI-aaa] local-user admin123 service-type ssh [HUAWEI-aaa] local-user admin123 privilege level 15 [HUAWEI-aaa] quit [HUAWEI] ssh user admin123 authentication-type password
# Enable the STelnet service.
[HUAWEI] stelnet server enable
# Configure the STelnet service type for the user admin123.
[HUAWEI] ssh user admin123 service-type stelnet
# Log in to the device using the third-party software (such as PuTTY). Enter the device IP address, select SSH, and enter the user name and password to log in to the device through STelnet.
To verify the STelnet login, run the ssh client first-time enable and stelnet 127.0.0.1 commands in system view to log in to the device. If the login page is displayed, the configuration succeeds. If the login page is not displayed, the configuration fails.
More Information: S Series Switches Common Operation Guide