华为交换机配置SSH远程登陆
概述:这篇文章介绍配置华为交换机配置SSH远程登陆,SSH协议是安全外壳协议,它是一种加密传输的远程管理协议,在等保测评中要求不能使用明文传输的Telnet协议,而是需要使用SSH进行远程管理交换机。
配置说明:目前基本上所有带有网管功能的华为交换机都支持SSH远程登陆,可以直接配置使用。
一、设置VTY界面支持的协议类型、认证方式和用户级别
[HUAWEI] user-interface vty 0 4
[HUAWEI-ui-vty0-4] authentication-mode aaa //配置VTY用户界面认证方式为AAA认证
[HUAWEI-ui-vty0-4] protocol inbound ssh //配置VTY用户界面支持的协议为SSH,默认情况下即SSH
[HUAWEI-ui-vty0-4] user privilege level 15 //配置VTY用户界面的级别为15
[HUAWEI-ui-vty0-4] quit
二、开启SSH服务端
//新版本华为交换机需要指定SSH服务器监听的接口和地址,默认未监听任何接口
[HUAWEI] ssh server-source -i all //指定全部接口监听SSH服务
备注:该命令仅在V200R020C00及之后版本使用,老版本交换机无需指定SSH服务监听的端口
[HUAWEI] stelnet server enable //开启设备的SSH服务器功能
三、创建AAA用户
[HUAWEI] aaa
[HUAWEI-aaa] local-user admin123 password irreversible-cipher My_Password123 //创建用户admin123,密码为加密的My_Password123
[HUAWEI-aaa] local-user admin123 privilege level 15 //配置本地用户级别为15
Warning: This operation may affect online users, are you sure to change the user privilege level ?[Y/N]y
[HUAWEI-aaa] local-user admin123 service-type ssh //配置本地用户的服务方式为SSH
[HUAWEI-aaa] quit
四、创建SSH用户
[HUAWEI] ssh user admin123 //创建SSH用户admin123(与aaa创建的用户同名)
[HUAWEI] ssh user admin123 service-type stelnet //配置SSH用户的服务方式为STelnet
[HUAWEI] ssh user admin123 authentication-type password //配置SSH用户认证方式为password
五、生成密钥对
//SSH是一种秘钥交换算法,需要在交换机本地生成密钥对
[HUAWEI] ecc local-key-pair create
Info: The key name will be: HUAWEI_Host_ECC.
Info: The key modulus can be any one of the following: 256, 384, 521.
Info: If the key modulus is greater than 512, it may take a few minutes.
Please input the modulus [default=521]:521
Info: Generating keys..........
Info: Succeeded in creating the ECC host keys.
六、使用SSH客户端进行登录
使用xshell、mobaxterm、putty等支持SSH的工具进行连接,连接成功表明配置完毕。
login as: admin123
Sent username "admin123"
admin123@10.10.10.20's password:
Info: The max number of VTY users is 8, and the number
of current VTY users on line is 5.
The current login time is 2018-12-22 09:35:28+00:00.