原文参考:http://www.qlhuawei.com/hcda/2013/0827/682.html


将一台路由器作为ssh server使用

使用stelnet去链接这个路由器。

比如,去上面下载一个更新包。或者下载路由器上的一个新的系统文件。


服务器端生成本地密钥对<Huawei> system-view
[Huawei] sysname SSH Server
[SSH Server] rsa local-key-pair create

在服务器端创建SSH用户# 配置VTY用户界面。
[SSH Server] user-interface vty 0 4
[SSH Server-ui-vty0-4] authentication-mode aaa
[SSH Server-ui-vty0-4] protocol inbound ssh
[SSH Server-ui-vty0-4] quit
创建SSH用户Client001。
# 新建用户名为Client001的SSH用户,配置密码为huawei,且认证方式为password。
[SSH Server] aaa
[SSH Server-aaa] local-user client001 password cipher huawei
[SSH Server-aaa] local-user client001 service-type ssh
[SSH Server-aaa] quit
[SSH Server] ssh user client001 authentication-type password
创建SSH用户Client002。
# 新建用户名为Client002的SSH用户,配置密码为huawei,且认证方式为RSA。
[SSH Server] aaa
[SSH Server-aaa] local-user client002 password cipher huawei
[SSH Server-aaa] local-user client002 service-type ssh
[SSH Server-aaa] quit
[SSH Server] ssh user client002 authentication-type rsa
配置服务器端RSA公钥# 客户端Client002生成客户端的本地密钥对
<Huawei> system-view
[Huawei] sysname client002
[client002] rsa local-key-pair create
# 查看客户端上生成RSA公钥。
[client002] display rsa local-key-pair public