华为交换机telnet,ssh配置

本文档详细介绍了如何在华为交换机上配置telnet和ssh服务,包括开启服务、设置管理VLAN、定义虚拟终端、创建用户及密钥。配置SSH涉及到创建RSA和DSA密钥,以及为用户指定SSH认证方式。通过这些步骤,网络管理员可以安全地远程管理设备。

华为交换机telnet,ssh配置

[Huawei]telnet server enable (开启对应服务就不说了)
[Huawei]stelnet server enable
1.配置管理vlan
[Huawei]interface Vlanif 1
[Huawei-Vlanif1]ip address 192.168.56.2 24
[Huawei-Vlanif1]qu
2.配置虚拟终端
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode aaa
[Huawei-ui-vty0-4]protocol inbound all
[Huawei-ui-vty0-4]qu
3.配置用户
[Huawei]aaa
[Huawei-aaa]local-user admin password cipher admin
[Huawei-aaa]local-user admin service-type telnet ssh
[Huawei-aaa]local-user admin privilege level 15

如果只配置telnet那么上述操作就可以了,如果配置ssh那么上述情况还不行。总的来说配置ssh比telnet多了两步,一是创建密钥,二是创建ssh用户(第二步可不要,因为上边已经添加了用户并且也设置了ssh服务类型,但其实上面添加的用户并不是使用真正的ssh协议登录的,不信可以使用dis ssh user-information这条命令查看一下,显示根本就没有ssh用户,这就比较深了,可以直接忽略)。

1.创建密钥(我这里创建了两种密钥,其实就两条命令,一条创建rsa密钥,一条创建dsa密钥)
[H3C]public-key local create rsa (创建rsa密钥)
[Huawei]rsa local-key-pair create
The key name will be: Huawei_Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
it will take a few minutes.
Input the bits in the modulus[default = 512]:
Generating keys…
…++++++++++++
.++++++++++++
…++++++++
…++++++++

[Huawei]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 : 512, 1024, 2048.
Info: If the key modulus is greater than 512, it may take a few minutes.
Please input the modulus [default=512]:
Info: Generating keys…
Info: Succeeded in creating the DSA host keys.
2.创建ssh用户
[Huawei]ssh user admin authentication-type password
[Huawei]ssh user admin service-type stelnet

华为交换机上查看SSH相关的配置信息,可以通过以下命令来实现: 1. **查看SSH服务器状态**: - 使用 `display ssh server status` 命令可以查看SSH服务器是否已经启用以及相关的配置信息。 - 例如: ```shell <HUAWEI> display ssh server status ``` 2. **查看SSH用户信息**: - 使用 `display ssh user` 命令可以查看当前配置SSH用户及其相关信息。 - 例如: ```shell <HUAWEI> display ssh user ``` 3. **查看SSH连接信息**: - 使用 `display ssh session` 命令可以查看当前的SSH会话信息。 - 例如: ```shell <HUAWEI> display ssh session ``` 4. **查看VTY线路配置**: - 使用 `display current-configuration` 命令可以查看当前配置文件中的VTY线路配置,包括SSH服务的启用情况。 - 例如: ```shell <HUAWEI> display current-configuration | include vty ``` 5. **查看SSH服务器的详细配置**: - 使用 `display ip ssh` 命令可以查看SSH服务器的详细配置信息,包括版本、加密算法等。 - 例如: ```shell <HUAWEI> display ip ssh ``` ### 示例配置 以下是一个典型的华为交换机上启用SSH服务的配置示例: ```shell <HUAWEI> system-view [HUAWEI] sysname Switch [Switch] aaa [Switch-aaa] local-user admin password simple xxx [Switch-aaa] local-user admin service-type ssh [Switch-aaa] local-user admin authorization-attribute user-role network-admin [Switch-aaa] quit [Switch] ssh server enable [Switch] ssh user admin service-type stelnet [Switch] ssh user admin authentication-type password [Switch] line vty 0 4 [Switch-line-vty0-4] authentication-mode scheme [Switch-line-vty0-4] protocol inbound ssh [Switch-line-vty0-4] idle-time 5 0 [Switch-line-vty0-4] quit ``` ### 相关问题 1. 如何在华为交换机上启用SSH服务? 2. 华为交换机如何配置SSH用户的权限? 3. 如何在华为交换机上查看当前的SSH会话信息? 4. 华为交换机如何配置VTY线路以支持SSH登录? 5. SSHTelnet华为交换机上的区别是什么?
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小子爵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值