华为交换机S5700-52C-EI开启ssh服务
参考资料
https://blog.csdn.net/qq_34815358/article/details/83865527
https://www.cnblogs.com/Cyanix/p/9992064.html
整理前
1、创建rsa本地密钥对与创建账号 <Quidway>system-view Enter system view, return user view with Ctrl+Z. 1)[Huawei]rsa local-key-pair create The key name will be: Huawei_Host The range of public key size is (512 ~ 2048). NOTES: If the key modulus is greater than 512, it will take a few minutes. Input the bits in the modulus[default = 512]: Generating keys... 2)华为交换机上面创建账号 aaa local-user admin password cipher admin1234 local-user admin privilege level 15 local-user admin service-type ssh local-user adminssh password cipher bw@123456 Info: Add a new user. local-user adminssh privilege level 3 \用户level最高到15 local-user adminssh service-type ssh 2、开启ssh服务以及ssh用户: stelnet server enable ssh user adminssh ssh user adminssh authentication-type password ssh user adminssh service-type stelnet 3、VTY下添加设置: [Huawei]user-interface vty 0 4 [Huawei-ui-vty0-4]authentication-mode aaa [Huawei-ui-vty0-4]protocol inbound ssh quit 4 路由 system-view interface Vlanif 1 ip address 172.16.72.254 255.255.255.0 interface GigabitEthernet0/0/1 ip route-static 0.0.0.0 0.0.0.0 172.16.72.1 quit exit 5.华为交换机初始化 reset saved-configuration y reboot 先N,后Y
整理后
1、创建本地密钥对 <Quidway>system-view [Quidway]rsa local-key-pair create The key name will be: Core-SW_Host The range of public key size is (512 ~ 2048). NOTES: If the key modulus is greater than 512, it will take a few minutes. Input the bits in the modulus[default = 2048]: Generating keys... ..+++++ ........................++ ....++++ ...........++ 2、检查是否存在SSH user(可跳过),系统提示没有SSH user 存在 [Quidway]dis ssh user-information Info: No SSH user exists. 3、创建SSH user [Quidway]ssh user adminssh # 将 adminssh用户变成ssh用户,可以直接敲第二行命令 [Quidway]ssh user adminssh authentication-type password #认证模式为密码认证 [Quidway]ssh user adminssh service-type stelnet # 服务类型为stelnet,即SSH 4、创建用户(也可创建华为用户,Telnet用户) [Quidway]aaa [Quidway-aaa]local-user adminssh password cipher bw@123456 # bw@123456处为你想要设置的密码 Info: Add a new user. [Quidway-aaa]local-user test privilege level 3 用户level最高到15 [Quidway-aaa]local-user test service-type ssh # 开启该用户允许使用SSH访问设备的权限 5、启用SSH(stelnet)服务 [Quidway]stelnet server enable Info: Succeeded in starting the Stelnet server. 6、配置vty界面支持的登录协议 [Quidway]user-interface vty 0 4 [Quidway-ui-vty0-4]authentication-mode aaa [Quidway-ui-vty0-4]protocol inbound ssh quit 7、路由 system-view interface Vlanif 1 ip address 172.16.72.254 255.255.255.0 interface GigabitEthernet0/0/1 ip route-static 0.0.0.0 0.0.0.0 172.16.72.1 quit exit 8、华为交换机初始化 reset saved-configuration y reboot 先N,后Y