华为交换机S5700系列配置通过STelnet登录设备示例
配置通过STelnet登录设备示例
组网图形
图1 配置用户通过STelnet登录设备组网图
在服务器端生成本地密钥对
1 2 3 4 5 6 7 8 9 | <HUAWEI> system-view [HUAWEI] sysname SSH_Server [SSH_Server] dsa local -key-pair create Info: The key name will be: HUAWEI_Host_DSA. Info: The key modulus can be any one of the following : 1024, 2048. Info: If the key modulus is greater than 512, it may take a few minutes. Please input the modulus [default=2048]: Info: Generating keys... Info: Succeeded in creating the DSA host keys. |
# 配置允许用户登录设备的主机地址。
1 2 3 4 5 6 | [Telnet_Server] acl 2001 [Telnet_Server-acl-basic-2001] rule permit source 10.1.1.1 0 [Telnet_Server-acl-basic-2001] quit [Telnet_Server] user-interface vty 0 14 [Telnet_Server-ui-vty0-14] protocol inbound ssh [Telnet_Server-ui-vty0-14] acl 2001 inbound |
# 新建用户名为client001的SSH用户,且认证方式为Password。
1 2 3 4 5 6 | [SSH_Server] aaa [SSH_Server-aaa] local -user client001 password irreversible-cipher Huawei@123 [SSH_Server-aaa] local -user client001 privilege level 3 [SSH_Server-aaa] local -user client001 service- type ssh [SSH_Server-aaa] quit [SSH_Server] ssh user client001 authentication- type password |
SSH服务器端开启STelnet服务功能
1 | [SSH_Server] stelnet server enable |
配置SSH用户client001的服务方式为STelnet
1 | [SSH_Server] ssh user client001 service- type stelnet |
验证配置结果
# PC端client001用password认证方式连接SSH服务器。
# 通过PuTTY软件登录设备,输入设备的IP地址,选择协议类型为SSH。
图2 通过PuTTY软件用password认证方式连接SSH服务器示意图
# 点击“Open”,出现如下界面,输入用户名和密码,并按Enter键,至此已登录到SSH服务器。(以下显示信息仅为示意)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | login as: client001 Sent username "client001" client001@10.137.217.203'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 2012-08-06 09:35:28+00:00. <SSH_Server> |
配置文件
SSH_Server的配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # sysname SSH_Server # aaa local -user client001 password irreversible-cipher $1a$aVW8S=aP=B<OWi1Bu '^R[=_!~oR*85r_nNY+kA(I}[TiLiVGR-i/' DFGAI-O$ local -user client001 privilege level 3 local -user client001 service- type ssh # stelnet server enable ssh user client001 ssh user client001 authentication- type password ssh user client001 service- type stelnet # user-interface vty 0 14 authentication-mode aaa # return |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步