华为交换机配置ssh登录(S5731)

admin 2023-8-21 1,038 8/21

创建本地秘钥

创建秘钥
rsa local-key-pair create

创建用户

[HUAWEI]aaa
[HUAWEI-aaa]local-user admin password cipher admin@huawei.com

赋予用户等级以及ssh登录权限

[HUAWEI-aaa]local-user admin privilege level 15
[HUAWEI-aaa]local-user admin service-type ssh
[HUAWEI-aaa]qu

开启ssh服务以及ssh用户

[HUAWEI]stelnet server enable
[HUAWEI]ssh user admin
Aug 21 2023 02:27:42 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 43, the change loop count is 0, and the maximum number of records is 4095. 
	
	
[HUAWEI]ssh user admin authentication-type password
[HUAWEI]ssh use	
[HUAWEI]ssh user 
Aug 21 2023 02:28:02 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 44, the change loop count is 0, and the maximum number of records is 4095.
[HUAWEI]ssh user admin	
[HUAWEI]ssh user admin s		
[HUAWEI]ssh user admin service-type ste	
[HUAWEI]ssh user admin service-type stelnet 
[HUAWEI]
Aug 21 2023 02:28:12 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 45, the change loop count is 0, and the maximum number of records is 4095.

vtv虚拟终端配置

[HUAWEI]user-interface vty 0 4
[HUAWEI-ui-vty0-4]authentication-mode aaa
Warning: The level of the user-interface(s) will be the default level of AAA users, please check whether it is correct.
[HUAWEI-ui-vty0-4]
Aug 21 2023 02:30:12 HUAWEI DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 46, the change loop count is 0, and the maximum number of records is 4095.
[HUAWEI-ui-vty0-4]pro	
[HUAWEI-ui-vty0-4]protocol in	
[HUAWEI-ui-vty0-4]protocol inbound ssh
[HUAWEI-ui-vty0-4]

新版本的交换机需要指定一个源地址登录设备,可以指定all或固定的vlanif接口地址(server-source all-interface)或者直接输入这条命令

[HUAWEI]ssh server-source all-interface 

20230821修改

如果出现配置后不能登录问题,可能是创建秘钥时候,安全等级过高所导致。可降低秘钥等级

HUAWEI]ssh server publickey rsa
Warning: Insecure encryption algorithms are enabled. Disabling them is recommended.

- THE END -

admin

11月08日17:41

最后修改:2023年11月8日
2

非特殊说明,本博所有文章均为博主原创。

共有 0 条评论