[ar1-aaa]local root password cipherAdmin@123> [ar1-aaa]local root service-type ssh
4、启用Stelnet服务
[ar1]stelnet server enable
5、生成RSA本地密钥
[ar1]rsa local-key-pair create
The key name will be: Host
% RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[n]:y
The range of public key> NOTES: If the key modulus is greater than512,
It will take a few minutes.
Input the bits in the modulus[default =512]:1024
Generating keys...
.++++++
.............++++++
.........................++++++++
....++++++++
6、虚拟机生成RSA密钥,注意
6.1、测试就选择了1024位数的密钥,越大越好
6.2、使用SSH-2 RSA密钥类型
6.3、密钥密码,是使用该密钥的个人密码,防止本机被其他人误用,下图中的红框部分
将转换后的结果,即蓝底部分复制备用
8、路由器上保存PC的公钥
[ar1]rsa peer-public-key test
Enter "RSA public key" view,return system view with "peer-public-key end".
NOTE: The number of the bits of public keymust be between 769 and 2048.
[ar1-rsa-public-key]public-key-code begin
Enter "RSA key code" view, returnlast view with "public-key-code end".
[ar1-rsa-key-code]30818702 81810096D2F89370 C0218C76 72C465BD 9FEF853D
[ar1-rsa-key-code]68266441 402C1E66A4A2735B 45006A16 99522B9F 8CAC3346
[ar1-rsa-key-code]BEC4AE9B 4D6675E009542394 85602340 C2245586 C78640CE
[ar1-rsa-key-code]31231630 52BD73D6587D1D7E 73D53876 EE923DB2 C4A753CE
[ar1-rsa-key-code]61520674 FFE735603FBFB3FD ED38794B 90EDA281 ED189231
[ar1-rsa-key-code]B8E24306 70D870DA0BC030BB 1EC6FF02 0125
[ar1-rsa-key-code]public-key-code end
[ar1-rsa-public-key]peer-public-key end
9、指定路由器上的用户使用RSA认证
[ar1]ssh user root assign rsa-key test
[ar1]ssh user root authentication-type rsa
10、在虚拟机上验证RSA登陆路由器
10.1、在虚拟机上打开putty,输入路由器IP地址