发布者:上海IT外包来源:http://www.lanmon.net点击数:5171
目前Cisco的产品只支持SSH-1,还不支持SSH-2.下面以GSR 12008为例详细介绍SSH-1的配置方法(斜体字为配置输入的命令):
① 配置hostname和ip domain-name:
Router#configure terminal Router(config)#hostname TEST-GSR12008 TEST-GSR12008(config)#ip domain-name jx.cn.net |
② 配置登录用户名和密码(以本地认证为例):
TEST-GSR12008(config)#username test password 0 test 注:添加一个用户:test,口令:test TEST-GSR12008(config)#line vty 0 4 TEST-GSR12008(config-line)#login local |
在这两部分做完以后,用show run命令就能够看到:
hostname TEST-GSR12008 ! boot system flash gsr-k3p-mz.120-14.S.bin enable secret 5 $1$DMyW$gdSIOkCr7p8ytwcRwtnJG. enable password 7 094F47C31A0A ! username test password 7 0835495D1D clock timezone PRC 16 redundancy main-cpu auto-sync startup-config ! ! ! ! ip subnet-zero no ip finger ip domain-name jx.cn.net ip name-server 202.101.224.68 ip name-server 202.101.226.68 ! |
③ 配置SSH服务:
TEST-GSR12008(config)#crypto key generate rsa The name for the keys will be: TEST-GSR12008.jx.cn.net 注:SSH的关键字名就是hostname + . +ip domain-name 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]: 注:选择加密位数,用默认就行了 Generating RSA keys ... [OK] TEST-GSR12008(config)#end TEST-GSR12008#write Building configuration... |
这时候用show run命令可以看到:
ip subnet-zero no ip finger ip domain-name jx.cn.net ip name-server 202.101.224.68 ip name-server 202.101.226.68 ip ssh time-out 120 ip ssh authentication-retries 3 ! |
用命令show ip ssh也能看到:
SSH Enabled - version 1.5 Authentication timeout: 120 secs; Authentication retries: 3 |
现在SSH服务已经启动,如果需要停止SSH服务,用以下命令:
TEST-GSR12008(config)#crypto key zeroize rsa |
④设置SSH参数
配置好了SSH之后,通过show run命令我们看到SSH默认的参数:超时限定为120秒,认证重试次数为3次,可以通过下面命令进行修改:
TEST-GSR12008(config)#ip ssh {[time-out seconds]} | [authentication-retries interger]} |
如果要把超时限定改为180秒,则应该用:
TEST-GSR12008(config)# ip ssh time-out 180 |
如果要把重试次数改成5次,则应该用:
TEST-GSR12008(config)# ip ssh authentication-retries 5 |
这样,SSH已经在路由器上配置成功了,就能够通过SSH进行安全登录了
1998年,蓝色学苑www.bluestudy.net创立了,我们翻译了大量路由交换的资料和调试案例,启蒙了大批网络技术爱好者。我们的创始人也在1999年通过CCIE认证,成为国内为数不多的老牌CCIE之一。2002年,蓝色学苑骨干成员成立蓝盟www.lanmon.com 专注于网络维护、网管外包、电脑维护、服务器升级、网络改造、系统集成、网络咨询、服务管理、运维咨询、ITIL培训、ITSS咨询等一站式IT外包服务。我们拥有近200名工程师,正在为近500家客户提供“一站式” 的IT外包服务。网址:www.lanmon.net 官方微博:http://weibo.com/lanmon2012 咨询电话:4008200159
版权声明:本站文章90%以上为蓝盟原创,转载请注明出处:www.lanmon.com。如有版权疑问随时致电:021-51693198-226,我们将第一时间给予答复。
|
分享到: