SSH是Secure Shell 的缩写,由国际互联网工程任务组(The Internet Engineering Task Force, IETF)的网络小组所制定。
SSH 是专为远程登录会话提供安全性的协议。利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题
从客户端来看,SSH提供两种级别的安全验证。
- 第一种级别是基于口令的安全验证。
- 第二种级别是基于密匙的安全验证。需要依靠密匙,也就是你必须为自己创建一对密匙,并把公用密匙
1、路由器配置(基于口令认证)
[AR1]user-interface vty 0 4 # 进入VTY用户视图
[AR1-ui-vty0-4]authentication-mode aaa # 设置虚拟终端认证模式为AAA
[AR1-ui-vty0-4]user privilege level 15 # 设置用户权限级别15
[AR1-ui-vty0-4]protocol inbound ssh # 开启SSH
[AR1-ui-vty0-4]quit
#
[AR1]aaa # 进入AAA视图
[AR1-aaa]local-user ssh-user password cipher abc@123 # 添加本地用户并设置密码
[AR1-aaa]local-user ssh-user privilege level 15 # 设置本地用户权限级别15
[AR1-aaa]local-user ssh-user service-type ssh # 设置本地用户允许SSH登录
[AR1-aaa]quit
#
[AR1]ssh user ssh-user authentication-type password # 设置SSH用户认证模式为密码认证
[AR1]stelnet server enable # 开启SSH认证服务
2、交换机配置(基于口令认证)
[LSW1]user-interface vty 0 4 # 进入VTY用户视图
[LSW1-ui-vty0-4]authentication-mode aaa # 设置虚拟终端认证模式为AAA
[LSW1-ui-vty0-4]protocol inbound ssh # 开启SSH
[LSW1-ui-vty0-4]quit
#
[LSW1]aaa # 进入AAA视图
[LSW1-aaa]local-user ssh-user password cipher abc@123 # 添加本地用户并设置密码
[LSW1-aaa]local-user ssh-user privilege level 15 # 设置本地用户权限级别15
[LSW1-aaa]local-user ssh-user service-type ssh # 设置本地用户允许SSH登录
[LSW1-aaa]quit
#
[LSW1]ssh user ssh-user authentication-type password # 设置SSH用户认证模式为密码认证
[LSW1]stelnet server enable # 开启SSH认证服务
[LSW1]ssh user ssh-user service-type stelnet # 设置SSH服务类型为stelnet(缺省情况下,SSH用户的服务方式是空,即不支持任何服务方式)