环境:
H3C S6520
version 7.1.070, Release 6530P02
问题描述:
H3C交换机如何配置SSH服务
组网需求
配置Host(SSH客户端)与Switch建立本地连接。Host采用SSH协议登录到Switch上,以保证数据信息交换的安全。SSH用户采用的认证方式为password认证,用户名和密码保存在本地设备上
解决方案:
<S6520>sy
System View: return to User View with Ctrl+Z.
[S6520] public-key local create rsa
The range of public key modulus is (512 ~ 4096).
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]:1024
Generating Keys...
.
Create the key pair successfully.
[S6520]public-key local create dsa
The range of public key modulus 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]:1024
Generating Keys...
..
Create the key pair successfully.
[S6520]ssh server enable
[S6520]sftp server enable(可选)
[S6520]line vty 0 4
[S6520-line-vty0-4]authentication-mode scheme
[S6520-line-vty0-4]protocol inbound ssh
[S6520-line-vty0-4]quit
[S6520]local-user cs class manage
New local user added.
[S6520-luser-manage-st]password simple 123
The password is too short. It must contain a minimum of 10 characters.
[S6520-luser-manage-st]password simple 12345678
[S6520-luser-manage-st]service-type ssh
[S6520-luser-manage-st]quit
[S6520]authorization-attribute user-role network-admin
最后保存一下
<S6520>sa
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
flash:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait...
Saved the current configuration to mainboard device successfully.
使用Xshell连接测试成功