日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

在CISCO交换机上配置SSH

發(fā)布時(shí)間:2025/4/5 编程问答 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 在CISCO交换机上配置SSH 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

在Cisco路由器產(chǎn)品系列中只有7200系列、7500系列和12000系列(GSR)等高端產(chǎn)品的IOS支持SSH.一般支持SSH的IOS版本文件名中都帶有K3或者K4字樣,K3 代表56bit SSH 加密,K4代表168bit SSH加密。如我省省網(wǎng)GSR 12016和12008上用的IOS 就是一個(gè)支持56bit SSH 加密的版本。

  目前Cisco的產(chǎn)品只支持SSH-1,還不支持SSH-2.下面以GSR 12008為例詳細(xì)介紹SSH-1的配置方法(斜體字為配置輸入的命令):

  ① 配置hostname和ip domain-name:

Router#configure terminal
Router(config)#hostname TEST-GSR12008
TEST-GSR12008(config)#ip domain-name jx.cn.net

 ?、?配置登錄用戶名和密碼(以本地認(rèn)證為例):

TEST-GSR12008(config)#username test password 0 test
? ? 注:添加一個(gè)用戶: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服務(wù)

TEST-GSR12008(config)#crypto key generate rsa
The name for the keys will be: TEST-GSR12008.jx.cn.net
注:SSH的關(guān)鍵字名就是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]: 注:選擇加密位數(shù),用默認(rèn)就行了
Generating RSA keys ...
[OK]
TEST-GSR12008(config)#end
TEST-GSR12008#write
Building configuration...
??????
 這時(shí)候用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
  現(xiàn)在SSH服務(wù)已經(jīng)啟動(dòng),如果需要停止SSH服務(wù),用以下命令:
TEST-GSR12008(config)#crypto key zeroize rsa
 ?、?span id="ozvdkddzhkzd" class="t_tag">設(shè)置SSH參數(shù)
  配置好了SSH之后,通過(guò)show run命令我們看到SSH默認(rèn)的參數(shù):超時(shí)限定為120秒,認(rèn)證重試次數(shù)為3次,可以通過(guò)下面命令進(jìn)行修改:
TEST-GSR12008(config)#ip ssh {[time-out seconds]} | [authentication-retries interger]}

  如果要把超時(shí)限定改為180秒,則應(yīng)該用:

TEST-GSR12008(config)# ip ssh time-out 180



  如果要把重試次數(shù)改成5次,則應(yīng)該用:

TEST-GSR12008(config)# ip ssh authentication-retries 5



  這樣,SSH已經(jīng)在路由器上配置成功了,就能夠通過(guò)SSH進(jìn)行安全登錄了

轉(zhuǎn)載于:https://blog.51cto.com/skycyc23/372720

總結(jié)

以上是生活随笔為你收集整理的在CISCO交换机上配置SSH的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。