cisco思科是全球領先的大品牌,相信很多人也不陌生,那么你知道cisco交換機上配置SSH嗎?下面是學習啦小編整理的一些關于cisco交換機上配置SSH的相關資料,供你參考。
cisco交換機上配置SSH:
在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 terminalRouter(config)#hostname TEST-GSR12008TEST-GSR12008(config)#ip domain-name jx.cn.net |
② 配置登錄用戶名和密碼(以本地認證為例):
TEST-GSR12008(config)#username test password 0 test 注:添加一個用戶:test,口令:testTEST-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.binenable secret 5 $1$DMyW$gdSIOkCr7p8ytwcRwtnJG.enable password 7 094F47C31A0A!username test password 7 0835495D1Dclock timezone PRC 16redundancymain-cpuauto-sync startup-config!!!!ip subnet-zerono ip fingerip domain-name jx.cn.netip name-server 202.101.224.68ip name-server 202.101.226.68 ! |
③ 配置SSH服務:
TEST-GSR12008(config)#crypto key generate rsaThe name for the keys will be: TEST-GSR12008.jx.cn.net注:SSH的關鍵字名就是hostname + . +ip domain-nameChoose the size of the key modulus in the range of 360 to 2048 for yourGeneral Purpose Keys. Choosing a key modulus greater than 512 may takea few minutes.How many bits in the modulus [512]: 注:選擇加密位數,用默認就行了Generating RSA keys ...[OK]TEST-GSR12008(config)#endTEST-GSR12008#writeBuilding configuration... |
這時候用show run命令可以看到:
ip subnet-zerono ip fingerip domain-name jx.cn.netip name-server 202.101.224.68ip name-server 202.101.226.68ip ssh time-out 120ip 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進行安全登錄了
看過文章“cisco交換機上配置SSH”的人還看了:
1.cisco思科路由器設置
2.思科路由器怎么進入 思科路由器怎么設置
3.思科路由器控制端口連接圖解
4.思科路由器基本配置教程
5.如何進入cisco路由器
6.cisco怎么進端口
7.cisco如何看未接來電
8.cisco常用命令
9.詳解思科route print
10.思科路由器恢復出廠配置的方法有哪些
新聞熱點
疑難解答