Chinaunix首页 | 论坛 | 博客
  • 博客访问: 72324
  • 博文数量: 28
  • 博客积分: 631
  • 博客等级: 上士
  • 技术积分: 220
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-08 22:23
文章分类

全部博文(28)

文章存档

2011年(28)

我的朋友

分类:

2011-08-20 22:53:08

  首先验证下IOS是否支持SSH,IOS名称特性集段出现KX(X为数字)字样,理论上就可以 在一个就是在特权模式下:R3#show ip ssh 出现:% Invalid input detected at '^' marker.好吧,人品
不好,不支持SSH!

 

 

 

 

 

第一步:建立本地的身份验证数据库

R3(config)#aaa new-model                           启用AAA功能

R3(config)#aaa authentication login ssh local      当有一个登陆行为时进行认证,选择身份验证由本地验证,起个名字叫ssh

R3(config)#username xx secret xx                   建立本地用户名xx 密码xx 的账户

第二步:应用到接口或链路

R3(config)#line vty 0 4                      进入虚拟终端

R3(config-line)#login authentication ssh     登陆验证方式为SSH

R3(config-line)#transport input ssh          设置vty只接收ssh登陆。

R3(config-line)#line vty 5 15                进入虚拟终端

R3(config-line)#login authentication ssh     登陆验证方式为SSH

R3(config-line)#transport input ssh          设置vty只接收ssh登陆。

 

第三步:配置ssh加密密钥

R3(config)#ip domain-name cisco.com          设置一个路由器的域名

R3(config)#crypto key generate rsa           用rsa散列算法

The name for the keys will be: R3.cisco.com

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.

How many bits in the modulus [512]:         默认密钥长度为512位

% Generating 512 bit RSA keys, keys will be non-exportable...[OK]

R3(config)#

Mar 25 01:20:22.359: %SSH-5-ENABLED: SSH 1.99 has been enabled 生成一个ssh的密钥

第四步:测试,从R1登陆R3,使用用户名xx,密码xx 登陆

R1#ssh -l xx 20.0.0.2

 

 

转自http://www.cuisir.org/ciscolab/05.html 谢谢!

 

阅读(1161) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~