一、实验拓扑
如图所示:华三交换机S6850 G1/0/1口直连PC。
二、配置示例
<H3C>system-view
[H3C]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]:
Generating Keys...
.
Create the key pair successfully.
[H3C]ssh server enable
[H3C]vlan 10
[H3C-vlan10]quit
[H3C]interface GigabitEthernet 1/0/1
[H3C-GigabitEthernet1/0/1]port link-type access
[H3C-GigabitEthernet1/0/1]port access vlan 10
[H3C-GigabitEthernet1/0/1]quit
[H3C]interface Vlan-interface 10
[H3C-Vlan-interface10]ip ad
[H3C-Vlan-interface10]ip address 192.168.1.248 24
[H3C-Vlan-interface10]quit
[H3C]line vty 0 4
[H3C-line-vty0-4]authentication-mode scheme
[H3C]local-user client001 class manage
New local user added.
[H3C-luser-manage-client001]password simple abcd@123456
[H3C-luser-manage-client001]service-type ssh
[H3C-luser-manage-client001]authorization-attribute user-role network-admin
[H3C-luser-manage-client001]quit
[H3C]ssh user client001 service-type stelnet authentication-type password
[H3C]quit
<H3C>save
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):
Validating file. Please wait...
Saved the current configuration to mainboard device successfully.
<H3C>