SSH (Secure Shell) 是一种面向网络设备提供安全的远程访问连接的协议。在SSH V1和SSH V2中,客户端与服务器之间的通信是加密的。由于SSH V2版本使用了更强大的安全加密算法,因此推荐配置SSH V2版本 。

Telnet协议存在安全风险,推荐使用STelnet登录设备。登录设备前,需要确保终端PC和设备之间路由可达。

配置步骤

1. 进入系统视图

<HUAWEI> system-view

2. 开启 STelnet 服

[HUAWEI] stelnet server enable

3. 指定 SSH 版本为 V2

[HUAWEI] ssh server version 2

4. 创建本地密钥对

[HUAWEI] rsa local-key-pair create

5. 创建 SSH 用户

[HUAWEI] ssh user user
[HUAWEI] ssh user user authentication-type password
[HUAWEI] ssh user user service-type stelnet

如果需要基于密钥认证,可改为:

[HUAWEI] ssh user user authentication-type rsa

6. AAA 模式下配置用户

[HUAWEI] aaa
[HUAWEI-aaa] local-user user password cipher user123
[HUAWEI-aaa] local-user user privilege level 15
[HUAWEI-aaa] local-user user service-type ssh

7. 配置 VTY 登录协议

[HUAWEI] user-interface vty 0 4
[HUAWEI-ui-vty0-4] authentication-mode aaa
[HUAWEI-ui-vty0-4] protocol inbound ssh

8. 限制登录失败次数与超时时间(安全加固)

[HUAWEI] ssh server authentication-retries 3
[HUAWEI] ssh server session-timeout 10

9. 保存配置

[HUAWEI-ui-vty0-4] quit
[HUAWEI] save

验证方法

在 PC 上执行:

ssh user@<设备IP>

输入密码 user123,确认能成功登录。

Copyright © https://yan-jian.com 2023 all right reserved更新时间: 2025-12-26 20:02:32

results matching ""

    No results matching ""