參考資料
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