console登陆用户名密码配置
aaa
local-user admin password cipher admin
local-user admin privilege level 15
local-user admin service-type terminal
提供console登陆的权限
user-interface con 0 //进入console也要aaa账号和密码
authentication-mode aaa
ssh配置:
配置STelnet登录。
在服务器端生成本地密钥对。
[DeviceA] rsa local-key-pair create
The key name will be:Host
The range of public key size is (2048, 3072).
NOTE: Key pair generation will take a short while.
Please input the modulus [default = 3072]:3072
#配置VTY用户界面0~4的认证方式为AAA认证、支持的协议为SSH。
[DeviceA] user-interface vty 0 4
[DeviceA-ui-vty0-4] authentication-mode aaa
[DeviceA-ui-vty0-4] protocol inbound ssh
[DeviceA-ui-vty0-4] quit
#开启设备的SSH服务器功能。
[DeviceA] stelnet server enable
[DeviceA] ssh server-source -i vlanif 10
配置所有SSH用户的认证方式为Password认证、服务方式为STelnet。
[DeviceA] ssh authentication-type default password
配置AAA本地认证。
[DeviceA] aaa
[DeviceA-aaa] local-user user1-huawei password irreversible-cipher
YsHsjx_202206
[DeviceA-aaa] local-user user1-huawei service-type ssh
[DeviceA-aaa] local-user user1-huawei privilege level 3
[DeviceA-aaa] quit
交换机客户端首次连接服务端
[S2]ssh client first-time enable
[S2]stelnet 192.168.2.2