一、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遠程登錄,如下所示,TELNET和SSH均允許遠程登錄,若限制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)