创建/更改console密码
<switch>system-view
Enter system view, return user view with Ctrl+Z.
[switch]user-interface console 0 //console口
[switch-ui-console0]authentication-mode password
[switch-ui-console0]set authentication password cipher password... //配置console密码
[switch-ui-console0]display this //接口下查看
#
user-interface con 0
authentication-mode password
set authentication password cipher 0GB:0w]8YDH\mr#J=^v<xo$# //查看到的密码为乱码
user-interface vty 0 4
#
return
[switch-ui-console0]
配置用户名、密码和telnet
<switch>system-view
[switch]aaa //3A模式
[switch-aaa]local-user admin password cipher password... //创建用户名和密码
[switch-aaa]local-user admin privilege level 15 //等级
[switch-aaa]local-user admin service-type telnet //协议
[switch-aaa]quit
设置VTY 0 4:
当authentication-mode后面接AAA时,用户名和密码调用3A里的local-user
[switch]user-interface vty 0 4
[switch-ui-vty0-4]authentication-mode aaa
[switch-ui-vty0-4]protocol inbound all
当authentication-mode 后面接password,密码调用VTY 0 4里的password
[switch]user-interface vty 0 4
[switch-ui-vty0-4]authentication-mode password
[switch-ui-vty0-4]set authentication password cipher password...
[switch-ui-vty0-4]user privilege level 15
[switch-ui-vty0-4]protocol inbound all
<S2>telnet 192.168.1.1
Trying 192.168.1.1 ...
Press CTRL+K to abort
Connected to 192.168.1.1 ...
Login authentication
Username:admin
Password:
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2024-01-12 12:43:35.
<switch>quit
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 0.
Info: The connection was closed by the remote host.
<S2>
<Huawei>telnet 192.168.1.1
Trying 192.168.1.1 ...
Press CTRL+K to abort
Connected to 192.168.1.1 ...
Login authentication
Password:
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2024-01-16 10:07:24.
<Huawei>quit
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 0.
Info: The connection was closed by the remote host.
<Huawei>