华为S/CE系列交换机stelnet示例(带外管理地址绑定vpn实现业务和管理平面的隔离)

组网需求

组网需求拓扑

配置思路

采用如下的思路配置通过STelnet登录其他设备:

1、在SSH服务器端生成本地密钥对,实现在服务器端和客户端进行安全的数据交互。

2、在SSH服务器端配置SSH用户admin。

3、在SSH服务器端开启STelnet服务功能。

4、在SSH服务器端配置SSH用户admin的服务方式为STelnet。

5、用户admin以STelnet方式实现登录SSH服务器。

操作步骤

在服务器端生成本地密钥对 (可选)

system-view
[HUAWEI] sysname SSH Server
[SSH Server] dsa local-key-pair create //可以省略该步骤
Info: The key name will be: SSH Server_Host_DSA.
Info: The DSA host key named SSH Server_Host_DSA already exists.
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.

在服务器端创建SSH用户

1.配置VTY用户界面。

[SSH Server] user-interface vty 0 4
[SSH Server-ui-vty0-4] authentication-mode aaa
[SSH Server-ui-vty0-4] protocol inbound all
[SSH Server-ui-vty0-4] quit

2.新建用户名为admin的SSH用户,且认证方式为password

[SSH Server] aaa
[SSH Server-aaa] local-user admin password irreversible-cipher Huawei@123
[SSH Server-aaa] local-user admin privilege level 3
[SSH Server-aaa] local-user admin service-type ssh terminal http
[SSH Server-aaa] quit

SSH服务器端开启STelnet服务功能

1.开启STelnet服务功能

[SSH Server] stelnet server enable //使能STelnet服务器功能。
[SSH Server] ssh server-source -i vlanif xx (XX代表管理vlan) V200R020及之后版本您还需要执行ssh

server-source -i xxxserver-source all interface
-i 提供ssh服务的是某物理或逻辑接口all interface 提供ssh服务的是所有物理和逻辑接口

2.配置SSH用户admin 的服务方式为STelnet

[SSH Server] ssh user admin service-type stelnet
[SSH Server] undo ssh server publickey //命令用来恢复SSH服务器所有公钥算法为缺省配置 不配置的话CRT连接因为算法问题无法连接
[SSH Server]ssh server cipher aes256_ctr aes128_ctr //配置SSH服务器端的加密算法为CTR加密算法

STelnet客户端连接SSH服务器

1.使能SSH客户端首次认证功能

[client001] ssh client first-time enable

2.验证配置是否正常

STelnet客户端admin用password认证方式连接SSH服务器,输入配置的用户名和密码。

2.1本地验证 stelnet 127.0.0.1 验证

登录交换机验证本地的ssh功能
stelnet 127.0.0.1

The server is not authenticated. Continue to access it? [Y/N] :y
Save the server’s public key? [Y/N] :y
The server’s public key will be saved with the name 10.1.1.1. Please wait…
Enter password:

2.2 配置Mth接口 PC连接Mth验证(拓扑图中client01假设PC)

实现业务和管理平面的隔离(给单独的ETH管理口加入VPN实例后,基于VPN实例配置一条默认路由)

[SSH Server]ip vpn-instance MGT
[SSH Server]ipv4-family

[SSH Server]int MEth 0/0/1
[SSH Server-MEth 0/0/1]ip binding vpn-instance MGT
[SSH Server-MEth 0/0/1]ip address X.X.X.X 24
[SSH Server]ip route-static vpn-instance MGT 0.0.0.0 0 X.X.X.254 (X.X.X.254为带外管理的网关地址)

将PC静态地址配置地址为10.1.2.2/16
打开CRT
使用CRT的SSH远程测试
The server is not authenticated. Continue to access it? [Y/N] :y
Save the server’s public key? [Y/N] :y
The server’s public key will be saved with the name 10.1.1.1. Please wait…
Enter password:

配置文件

S系列6730 /5731配置

user-interface vty 0 4
authentication-mode aaa
user privilege level 15
protocol inbound all

quit

aaa
local-user admin password irreversible-cipher XXX
local-user admin privilege level 15
local-user admin service-type terminal ssh http
undo local-aaa-user password policy administrator
quit

stelnet server enable
ssh server-source all-interface
y
ssh user admin authentication-type password
ssh user admin service-type stelnet
ssh client first-time enable
ssh server cipher aes256_ctr aes128_ctr
undo ssh server publickey

(可选)
ssh server key-exchange dh_group_exchange_sha256 dh_group1_sha1
ssh server cipher 3des_cbc aes128_cbc aes128_ctr aes256_cbc aes256_ctr des_cbc
ssh server hmac md5 md5_96 sha1 sha1_96 sha2_256 sha2_256_96
ssh server publickey dsa ecc rsa rsa_sha2_256 rsa_sha2_512

  • 2
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在华为交换机s5735s上配置SSH,可以按照以下步骤进行操作: 1. 首先,使用管理员权限登录到交换机的命令行界面。 2. 进入系统视图,输入system-view命令。 3. 配置SSH用户认证方式,可以选择使用密码认证。通过执行以下命令启用SSH用户认证方式为密码认证: ``` [HUAWEI] ssh user client001 authentication-type password ``` 这里的client001是你要配置的SSH用户账号,可以根据实际情况进行修改。 4. 开启SSH登录方式为stelnet,即通过执行以下命令启用SSH服务类型为stelnet: ``` [HUAWEI] ssh user huawei service-type stelnet ``` 这里的huawei是你要配置的SSH用户账号,可以根据实际情况进行修改。 5. 配置本地用户的服务类型为SSH,可以通过执行以下命令配置: ``` [HUAWEI-aaa] local-user client001 service-type ssh ``` 这里的client001是你要配置的本地用户账号,可以根据实际情况进行修改。 通过以上步骤配置后,你就成功在华为交换机s5735s上配置了SSH登录方式。请确保在进行任何配置之前备份你的交换机配置,并根据需要进行适当的修改。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [华为交换机S5735S配置SSH](https://blog.csdn.net/weixin_41234799/article/details/130829899)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [华为s5735交换机配置ssh远程登陆](https://blog.csdn.net/qq_45024110/article/details/128257908)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值