(1)配置Stelnet服务器
#生成RSA密钥对。
system-view
[Switch] public-key local create rsa
The range of public key size 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]:
Generating Keys...
........................++++++
...................++++++
..++++++++
............++++++++
Create the key pair successfully.
#生成DSA密钥对。
[AC] public-key local create dsa
The range of public key size 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]:
Generating Keys...
.++++++++++++++++++++++++++++++++++++++++++++++++++*
........+......+.....+......................................+
...+.................+..........+...+.
Create the key pair successfully.
#生成ECDSA密钥对。
[AC] public-key local create ecdsa secp256r1
Generating Keys...
.
Create the key pair successfully.
#使能Stelnet服务器功能。
[AC] ssh server enable
#配置VLAN接口2的IP地址,客户端将通过该地址连接Stelnet服务器。
[AC] interface vlan-interface 2
[AC-Vlan-interface2] ip address 192.168.1.40 255.255.255.0
[AC-Vlan-interface2] quit
#设置Stelnet客户端登录用户线的认证方式为AAA认证。
[AC] line vty 0 15
[AC-line-vty0-15] authentication-mode scheme
[AC-line-vty0-15] quit
#创建设备管理类本地用户client001,并设置密码为明文aabbcc,服务类型为SSH,用户角色为network-admin。
[AC] local-user client001 class manage
[AC-luser-manage-client001] password simple aabbcc
[AC-luser-manage-client001] service-type ssh
[AC-luser-manage-client001] authorization-attribute user-role network-admin
[AC-luser-manage-client001] quit
#配置SSH用户client001的服务类型为Stelnet,认证方式为password认证。(此步骤可以不配置)
[AC] ssh user client001 service-type stelnet authentication-type password
(2)Stelnet客户端建立与Stelnet服务器的连接
Stelnet客户端软件有很多,例如PuTTY、OpenSSH等。本文中仅以客户端软件PuTTY0.58为例,说明Stelnet客户端的配置方法。
打开PuTTY.exe程序,出现如图2所示的客户端配置界面。在“Host Name(or IP address)”文本框中输入Stelnet服务器的IP地址为192.168.1.40。
在图2中,单击按钮。按提示输入用户名client001及密码aabbcc,即可进入AC的配置界面。