华为交换机telnet,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,telnet,交换机,huawei)