H3C S5130-EI系列以太网交换机典型配置-SSH典型配置

配置步骤

生成 RSA 密钥对。

1
2
3
4
5
6
7
8
9
10
11
12
<Device> system-view 
[Device] public-key local create rsa
The range of public key size is (512 ~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024]:
Generating Keys...
........................++++++
...................++++++
..++++++++
............++++++++
Create the key pair successfully.

生成 DSA 密钥对。

1
2
3
4
5
6
7
8
9
10
[Device] public-key local create dsa 
The range of public key size is (512 ~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024]:
Generating Keys...
.++++++++++++++++++++++++++++++++++++++++++++++++++*
........+......+.....+......................................+
...+.................+..........+...+.
Create the key pair successfully.

使能 SSH 服务器功能。

1
[Device] ssh server enable

创建 VLAN 2,并将 GigabitEthernet1/0/2 加入 VLAN 2。

1
2
3
[Device] vlan 2 
[Device-vlan2] port gigabitethernet 1/0/2
[Device-vlan2] quit

配置 VLAN 接口 2 的 IP 地址,客户端将通过该地址连接 Stelnet 服务器。

1
2
3
[Device] interface vlan-interface 2 
[Device-Vlan-interface2] ip address 192.168.1.40 255.255.255.0
[Device-Vlan-interface2] quit

设置 Stelnet 客户端登录用户界面的认证方式为 scheme。

1
2
3
[Device] line vty 0 63 
[Device-line-vty0-63] authentication-mode scheme
[Device-line-vty0-63] quit

创建本地用户 client001,并设置用户密码、服务类型和用户角色。

1
2
3
4
5
6
[Device] local-user client001 class manage 
New local user added.
[Device-luser-manage-client001] password simple aabbcc
[Device-luser-manage-client001] service-type ssh
[Device-luser-manage-client001] authorization-attribute user-role network-admin
[Device-luser-manage-client001] quit

验证配置
打开PuTTY.exe程序,点击“Session”功能区
• 在“Host Name(or IP address)”文本框中输入 Stelnet 服务器的 IP 地址为 192.168.1.40。
• 在“Port”文本框中输入 SSH 协议端口号 22。
• 在“Connection type”区域选择 SSH 协议。


H3C S5130-EI系列以太网交换机典型配置-SSH典型配置
http://maitianxin.github.io/2020/10/09/other/h3c_ssh/
作者
Matianxin
发布于
2020年10月9日
许可协议