一、TELNET远程登录配置

1、配置CISCO路由器上登录账号、口令、账号级别,如下所示,账号名abc、口令为abc123、账号级别为15(最高级别)


R1#configure terminal

R1(config)#username abc privilege 15 secret abc123

R1(config)#end

R1#


2、配置CISCO路由器远程登录认证机制,如下所示,配置路由器本地认证


R1#configure terminal

R1(config)#line vty 0 4

R1(config-line)#login local

R1(config-line)#end

R1#


3、完成以上配置后,即可实现TELNET登录


二、SSH远程登录配置

1、配置SSH远程登录前,需要先配置上面两个步骤

2、配置CISCO路由器所在域名,如下所示,域名为idc


R1(config)#ip domain-name idc


3、配置CISCO路由器生成密钥,路由器提供配置密钥位数,完成该配置后,路由器自动启动SSH服务,可以使用show ip ssh命令查看验证


R1(config)#ip domain-name idc

R1(config)#crypto key generate rsa

The name for the keys will be: R1.idc

Choose the size of the key modulus in the range of 360 to 2048 foryour

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

a few minutes.


How many bits in the modulus [512]: 1024

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


R1(config)#

*Aug 13 15:08:21.575: %SSH-5-ENABLED: SSH 1.99 has been enabled

R1(config)#



4、配置CISCO路由器允许通过SSH远程登录,如下所示,TELNETSSH均允许远程登录,若限制TELNET远程登录,则transportinput后不要带telnet即可。


R1(config)#line vty 0 4

R1(config-line)#transport input telnet ssh

R1(config-line)#end

R1#


5、完成以上配置后,即可实现SSH登录


路由器版本信息:CiscoIOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), ExperimentalVersion 12.4(20090407:185408)

本文出自 “QiRui” 博客,请务必保留此出处http://qirui.blog.51cto.com/845978/1272594