找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
.COM/.NET/.ORG 国际域名注册全功能虚拟主机/免备案虚拟主机
查看: 4468|回复: 8

通过SSH实现Cisco路由器登录

[复制链接]

77

主题

701

回帖

1万

积分

论坛元老

积分
16048
发表于 2004-8-23 21:35:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
在Cisco路由器产品系列中只有7200系列、7500系列和12000系列(GSR)等高端产品的IOS支持SSH。一般支持SSH的IOS版本文件名中都带有K3或者K4字样,K3 代表56bit SSH 加密,K4代表168bit SSH加密。如我省省网GSR 12016和12008上用的IOS 就是一个支持56bit SSH 加密的版本。目前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进行安全登录了。
回复

使用道具 举报

281

主题

3228

回帖

55万

积分

管理员

积分
551869
发表于 2004-8-24 09:34:30 | 显示全部楼层
精华啊!
网路游侠 www.youxia.org
回复 支持 反对

使用道具 举报

2

主题

22

回帖

3109

积分

论坛元老

积分
3109
发表于 2004-8-24 12:40:54 | 显示全部楼层
[emb6]
回复 支持 反对

使用道具 举报

77

主题

701

回帖

1万

积分

论坛元老

积分
16048
 楼主| 发表于 2004-8-25 00:02:31 | 显示全部楼层
谢谢!今天继续!!
回复 支持 反对

使用道具 举报

18

主题

55

回帖

3301

积分

论坛元老

积分
3301
发表于 2004-8-25 18:36:23 | 显示全部楼层
真实好呀,精华!!![emb7]
千里之行,始于足下!
回复 支持 反对

使用道具 举报

77

主题

701

回帖

1万

积分

论坛元老

积分
16048
 楼主| 发表于 2007-6-17 13:53:27 | 显示全部楼层
更新一下:
现在Cisco的IOS,k=此IOS带有安全特性, k8 = 56bit des 加密,k9=168bit 3des 加密。
大家有兴趣的话,可以去www.cisco.com下载一个命名手册。会更全,更多。
回复 支持 反对

使用道具 举报

0

主题

5

回帖

3025

积分

论坛元老

积分
3025
发表于 2008-5-4 14:24:14 | 显示全部楼层

太好了

强强强~~~~~~~~~~~,太好了,谢谢

---------------
Where you may get the best price for world of warcraft gold, and the fastest delivery of gold on world of warcraft with no minimal purchase necessary! We rock the World of warcraft gold EU market by continue to lower our lowest price !  world of warcraft gold EU and world of warcraft gold US at our webgage! Welcome to our website for you World of Warcraft Gold,WoW Gold,Cheap World of Warcraft Gold,buy cheap WoW Gold,real WoW Gold !
这里好啊!
回复 支持 反对

使用道具 举报

77

主题

701

回帖

1万

积分

论坛元老

积分
16048
 楼主| 发表于 2008-9-2 11:15:33 | 显示全部楼层
哇塞,我04年发的帖还在呀!!!!
回复 支持 反对

使用道具 举报

281

主题

3228

回帖

55万

积分

管理员

积分
551869
发表于 2008-9-2 22:17:48 | 显示全部楼层
引用第7楼leo于2008-09-02 11:15发表的:
哇塞,我04年发的帖还在呀!!!!
你的帖子见证了网站的历史和发展 呵呵
网路游侠 www.youxia.org
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|西京校友网 ( 陕ICP备11003551号-5 )

GMT+8, 2025-5-6 13:28 , Processed in 0.036329 second(s), 7 queries , MemCache On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表