国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 網(wǎng)絡(luò)通信 > 正文

配置路由器和交換機(jī)上的安全Shell運(yùn)行的Cisco IOS

2019-11-05 00:43:16
字體:
供稿:網(wǎng)友

  前言
  本文討論配置和調(diào)試安 全外殼(SSH)在運(yùn)行的Cisco IOS軟件的版本支持 SSH® Cisco 路由器或交換機(jī)。欲知關(guān)于特定 版本和軟件鏡象的,下面請(qǐng)參閱更多信息。
  
  使 用的組件
  本文的信息根 據(jù)以下的軟件及硬件版本。
  
  Cisco IOS 3600軟件(C3640-IK9S-M),版本 12.2(2)T1
  
  SSH介紹到 IOS platforms/images如下所示。
  
  SSH版本1.0 (SSHv1)服務(wù)器在起動(dòng)在12.0.5.S 的一 些IOS platforms/images被引入了。
  
  SSH客戶端在開始在12.1.3.T的一些IOS platforms/images介紹。
  
  SSH終端線 路接入(亦稱反向Telnet)在開始在12.2.2.T的一些 IOS platforms/images被引入。
  
  關(guān) 于信息關(guān)于SSH技術(shù)支持在交換機(jī),參見 如何 配置SSH在運(yùn)行CatcOs的Catalyst交換機(jī)。
  
  關(guān)于一張完全特性集列表不同的平臺(tái) 支持用不同的Cisco IOS版本和,參見 軟件 顧問 (注冊(cè)的用戶)。
  
  本文提供的信息在特定實(shí)驗(yàn)室環(huán)境里從設(shè)備被創(chuàng)建了 。用于本文的所有設(shè)備開始了以一個(gè)缺省(默認(rèn))配置。 假如在一個(gè)真實(shí)網(wǎng)絡(luò)工作,保證您使用它以前了解所有命令 的潛在影響。
  
  SSHv1與SSHv2
  此時(shí),IOS只支持SSHv1; Cisco沒有計(jì)劃實(shí)現(xiàn) SSHv2。有此的幾個(gè)原因,如下所述。
  
  Cisco在Cisco IOS實(shí)現(xiàn)SSH當(dāng)ip安全(IPSec) 通過互 聯(lián)網(wǎng)工程任務(wù)組(IETF)被開發(fā)。在IPSec 開發(fā)過程期間,而 SSH的實(shí)施在IOS是更多一項(xiàng)戰(zhàn)術(shù)措施提供接入路由器一個(gè)安全的方 法IPSec 是核心功能。Cisco投入人員維護(hù)SSH功能為修正, 但增進(jìn)將制定要求低優(yōu)先級(jí)。Cisco 做到配置IPSec為獲取 所有數(shù)據(jù)流,包括治理數(shù)據(jù)流到/從Cisco網(wǎng)絡(luò)設(shè)備。
  
  假如弱點(diǎn)在SSHv1的協(xié)議或?qū)嵤┍话l(fā) 現(xiàn),將制定他們的復(fù)核最優(yōu)先考慮的事,和所有潛在安全漏洞。 注重Cisco IOS編碼不是相同作為代碼在UNIX、Windows,或 者所有其他設(shè)備查找。同樣地,一個(gè)編碼問題在那些實(shí)施之 一中在Cisco IOS很可能不會(huì)查找。 另外,不是所有的SSHv1 功能在Cisco實(shí)施可以被發(fā)現(xiàn)。值得注重,SSH在Cisco IOS不 提供"會(huì)話轉(zhuǎn)發(fā)",亦不提供建立隧道X11。 缺陷在通用代碼 的這些部分不會(huì)是一個(gè)問題在Cisco IOS。假如任何申明的協(xié) 議缺陷回顧表示,SSHv1協(xié)議在Cisco IOS是根本上殘破的,則Cisco 確定那時(shí)移植到SSHv2是否是適當(dāng)?shù)摹?
  
  
網(wǎng)絡(luò)圖

  

  測試認(rèn)證
  測試認(rèn)證沒有 SSH
  我們測試認(rèn)證沒有 SSH首先將確信,認(rèn)證通過用路由器卡特在添加SSH之前。 認(rèn) 證可以用運(yùn)行TACACS+或RADIUS的驗(yàn)證、授權(quán)和記帳(AAA)服務(wù)器是 帶有一個(gè)本地用戶名/密碼或。(認(rèn)證通過線路密碼不是可能 的與SSH。) 下面的示例顯示本地認(rèn)證,讓我們遠(yuǎn)程登錄到路 由器帶有用戶名"cisco" 和密碼"cisco"。
  
  !--- aaa new-model causes the local username/passWord on the router
  !--- to be used in the absence of other aaa statements.
  
  aaa new-model
  username cisco password 0 cisco
  line vty 0 4
  
  !--- Instead of aaa new-model, the login local command may be used.
  
  測試認(rèn)證與 SSH
  對(duì)測試認(rèn)證與SSH, 我們?cè)诳ㄌ匮a(bǔ)充說到前面的語句,啟用SSH和測試SSH從PC和UNIX 工作站。
  
  ip domain-name rtp.cisco.com
  
   !--- Generate an SSH key to be used with SSH.
  
   cry key generate rsa
   ip ssh time-out 60
   ip ssh authentication-retries 2
  這時(shí),顯示 生成的鍵, show cry key mypubkey rsa命令應(yīng)該。在添加SSH配置以后 ,我們測試訪問路由器從PC和UNIX 工作站。
  
  可選配置設(shè)置
  防止Non-SSH連接
  假如我們想要防止non-SSH連接,我們添加 transport input SSH 在 線路之下對(duì)僅SSH連接限制路由器。平直的 (non-SSH) Telnets將拒絕。
  
  line vty 0 4
  
   !--- PRevent non-SSH Telnets.
  
   transport input ssh
  
  我們測 試是確保的non-SSH用戶不能遠(yuǎn)程登錄到路由器卡特。
  
  設(shè)置IOS 路由器或交換機(jī)作為SSH 客戶端
  有為啟用SSH技術(shù)支持要求的四個(gè)步驟在IOS路由器。
  
  配置 hostname命令。
  
  配置DNS域。
  
  生成將使用的SSH鍵。
  
  啟用SSH vtys的傳輸技術(shù)支持。
  
  假如我們想要有一次設(shè)備操作作為SSH 客戶端對(duì)其 他,我們能添加SSH到第二個(gè)設(shè)備,Reed。設(shè)備然后在客戶端 服務(wù)器排列,用作為服務(wù)器和Reed的卡特作為客戶端。 IOS SSH客戶端配置在Reed是相同象為SSH 服務(wù)器配置需要 在卡特。
  
  !--- Step 1: Configure hostname if you have not previously done so.
  
  hostname carter
  
  !--- aaa new-model causes the local username/password on the router
  !--- to be used in the absence of other AAA statements.
  
  aaa new-model
  username cisco password 0 cisco
  
  !--- Step 2: Configure the router's DNS domain.
  
  ip domain-name rtp.cisco.com
  
  !--- Step 3: Generate an SSH key to be used with SSH.
  
  cry key generate rsa
  ip ssh time-out 60
  ip ssh authentication-retries 2
  
  !--- Step 4: By default the vtys' transport is Telnet. In this case,
  !--- Telnet has been disabled and only SSH is supported.
  
  line vty 0 4
  transport input SSH
  
  !--- Instead of aaa new-model, the login local command may be used.
  
  測試此,發(fā)出以下命令對(duì) SSH從IOS SSH 客戶端(Reed)到IOS SSH服務(wù)器(卡特):
  
   ssh -l cisco -c 3des 10.13.1.99
  
  添加SSH 終端線路接入
  假如 我們需要出局SSH終端線路驗(yàn)證,我們能為出局反向Telnet配置和測 試SSH通過卡特,作為通用服務(wù)器對(duì)Philly。
  
  ip ssh port 2001 rotary 1
   line 1 16
    no exec
    rotary 1
    transport input ssh
    exec-timeout 0 0
    modem In Out
    Stopbits 1
  假如Philly附有Carter端口2,我們會(huì)SSH 對(duì)Philly 通過卡特從Reed用以下命令:
  
   ssh -c 3des -p 2002 10.13.1.99
  
  從 Solaris,我們會(huì)使用以下命令:
  
   ssh -c 3des -p 2002 -x -v 10.13.1.99
  
  debug及show命令
  在發(fā)出如下 被描述和說明的debug命令 之前,請(qǐng)參閱 重要信息關(guān)于Debug命令。 輸 出解釋器工具支持 某些show命令 (注 冊(cè)的用戶),答應(yīng)您查看show命令輸出分析 。
  
  debug IP SSH - 顯示調(diào) 試消息為SSH。
  
  show SSH - 顯示SSH服 務(wù)器連接狀態(tài)。
  
  carter#show ssh
    Connection  Version Encryption  State       Username
    0      1.5   DES      session started  cisco
  
  show ip ssh - 顯示版 本和配置數(shù)據(jù)為SSH。
  
  carter#sho ip ssh
    SSH Enabled - version 1.5
    Authentication timeout: 60 secs; Authentication retries: 2
  
  示例調(diào)試輸出
  注重一些此"好"調(diào)試輸出包裹對(duì)多條線路由于間距注 意事項(xiàng)。
  
  路由器調(diào)試
  00:23:20: SSH0: starting SSH control process
  00:23:20: SSH0: sent protocol version id SSH-1.5-Cisco-1.25
  00:23:20: SSH0: protocol version id is - SSH-1.5-1.2.26
  00:23:20: SSH0: SSH_SMSG_PUBLIC_KEY msg
  00:23:21: SSH0: SSH_CMSG_SESSION_KEY msg - length 112, type 0x03
  00:23:21: SSH: RSA decrypt started
  00:23:21: SSH: RSA decrypt finished
  00:23:21: SSH: RSA decrypt started
  00:23:21: SSH: RSA decrypt finished
  00:23:21: SSH0: sending encryption confirmation
  00:23:21: SSH0: keys exchanged and encryption on
  00:23:21: SSH0: SSH_CMSG_USER message received
  00:23:21: SSH0: authentication request for userid cisco
  00:23:21: SSH0: SSH_SMSG_FAILURE message sent
  00:23:23: SSH0: SSH_CMSG_AUTH_PASSWORD message received
  00:23:23: SSH0: authentication sUCcessful for cisco
  00:23:23: SSH0: requesting TTY
  00:23:23: SSH0: setting TTY - requested: length 24, width 80; set:
    length 24, width 80
  00:23:23: SSH0: invalid request - 0x22
  00:23:23: SSH0: SSH_CMSG_EXEC_SHELL message received
  00:23:23: SSH0: starting shell for vty
  
  服務(wù)器調(diào)試
  注重: 此輸出在Solaris 設(shè)備 被獲取了。
  
  rtp-evergreen.rtp.cisco.com# ssh -c 3des -l cisco -v 10.31.1.99
  rtp-evergreen# /opt/CISssh/bin/ssh -c 3des -l cisco -v 10.13.1.99
  SSH Version 1.2.26 [sparc-sun-solaris2.5.1], protocol version 1.5.
  Compiled with RSAREF.
  rtp-evergreen: Reading configuration data /opt/CISssh/etc/ssh_config
  rtp-evergreen: ssh_connect: getuid 0 geteuid 0 anon 0
  rtp-evergreen: Allocated local port 1023.
  rtp-evergreen: Connecting to 10.13.1.99 port 22.
  rtp-evergreen: Connection established.
  rtp-evergreen: Remote protocol version 1.5,
    remote software version Cisco-1.25
  rtp-evergreen: Waiting for server public key.
  rtp-evergreen: Received server public key (768 bits)
    and host key (512 bits).
  rtp-evergreen: Host '10.13.1.99' is known and matches the host key.
  rtp-evergreen: Initializing random; seed file //.ssh/random_seed
  rtp-evergreen: Encryption type: 3des
  rtp-evergreen: Sent encrypted session key.
  rtp-evergreen: Installing crc compensation attack detector.
  rtp-evergreen: Received encrypted confirmation.
  rtp-evergreen: Doing password authentication.
  cisco@10.13.1.99's password:
  rtp-evergreen: Requesting pty.
  rtp-evergreen: Failed to get local xauth data.
  rtp-evergreen: Requesting X11 forwarding with authentication spoofing.
  Warning: Remote host denied X11 forwarding, perhaps xauth program
    could not be run on the server side.
  rtp-evergreen: Requesting shell.
  rtp-evergreen: Entering interactive session.
  
  錯(cuò)在何處
  下面是示例調(diào)試輸出從幾個(gè)不正確的配置。
  
  SSH從SSH 客戶端沒被編譯帶有數(shù)據(jù)加密標(biāo)準(zhǔn) (DES)
  
  Solaris調(diào)試
  rtp-evergreen# /opt/CISssh/bin/ssh -c des -l cisco -v 10.13.1.99
  SSH Version 1.2.26 [sparc-sun-solaris2.5.1], protocol version 1.5.
  Compiled with RSAREF.
  rtp-evergreen: Reading configuration data /opt/CISssh/etc/ssh_config
  rtp-evergreen: ssh_connect: getuid 0 geteuid 0 anon 0
  rtp-evergreen: Allocated local port 1023.
  rtp-evergreen: Connecting to 10.13.1.99 port 22.
  rtp-evergreen: Connection established.
  rtp-evergreen: Remote protocol version 1.5,
    remote software version Cisco-1.25
  rtp-evergreen: Waiting for server public key.
  rtp-evergreen: Received server public key (768 bits)
    and host key (512 bits).
  rtp-evergreen: Host '10.13.1.99' is known and matches the host key.
  rtp-evergreen: Initializing random; seed file //.ssh/random_seed
  rtp-evergreen: Encryption type: des
  rtp-evergreen: Sent encrypted session key.
  cipher_set_key: unknown cipher: 2
  
  路由器調(diào)試
  
  00:24:41: SSH0: Session terminated normally
  00:24:55: SSH0: starting SSH control process
  00:24:55: SSH0: sent protocol version id SSH-1.5-Cisco-1.25
  00:24:55: SSH0: protocol version id is - SSH-1.5-1.2.26
  00:24:55: SSH0: SSH_SMSG_PUBLIC_KEY msg
  00:24:55: SSH0: SSH_CMSG_SESSION_KEY msg - length 112, type 0x03
  00:24:55: SSH: RSA decrypt started
  00:24:56: SSH: RSA decrypt finished
  00:24:56: SSH: RSA decrypt started
  00:24:56: SSH: RSA decrypt finished
  00:24:56: SSH0: sending encryption confirmation
  00:24:56: SSH0: Session disconnected - error 0x07
  
  錯(cuò)誤密碼
  路由器調(diào)試
  00:26:51: SSH0: starting SSH control process
  00:26:51: SSH0: sent protocol version id SSH-1.5-Cisco-1.25
  00:26:52: SSH0: protocol version id is - SSH-1.5-1.2.26
  00:26:52: SSH0: SSH_SMSG_PUBLIC_KEY msg
  00:26:52: SSH0: SSH_CMSG_SESSION_KEY msg - length 112, type 0x03
  00:26:52: SSH: RSA decrypt started
  00:26:52: SSH: RSA decrypt finished
  00:26:52: SSH: RSA decrypt started
  00:26:52: SSH: RSA decrypt finished
  00:26:52: SSH0: sending encryption confirmation
  00:26:52: SSH0: keys exchanged and encryption on
  00:26:52: SSH0: SSH_CMSG_USER message received
  00:26:52: SSH0: authentication request for userid cisco
  00:26:52: SSH0: SSH_SMSG_FAILURE message sent
  00:26:54: SSH0: SSH_CMSG_AUTH_PASSWORD message received
  00:26:54: SSH0: password authentication failed for cisco
  00:26:54: SSH0: SSH_SMSG_FAILURE message sent
  00:26:54: SSH0: authentication failed for cisco (code=7)
  00:26:54: SSH0: Session disconnected - error 0x07
  
  SSH客戶端發(fā)送不支持的(Blowfish) 密碼
  路由器調(diào)試
  00:39:26: SSH0: starting SSH control process
  00:39:26: SSH0: sent protocol version id SSH-1.5-Cisco-1.25
  00:39:26: SSH0: protocol version id is - SSH-1.5-W1.0
  00:39:26: SSH0: SSH_SMSG_PUBLIC_KEY msg
  00:39:26: SSH0: SSH_CMSG_SESSION_KEY msg - length 112, type 0x03
  00:39:26: SSH0: Session disconnected - error 0x20


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 耒阳市| 广南县| 丘北县| 惠来县| 鄂温| 大连市| 章丘市| 望江县| 武乡县| 安康市| 永修县| 汕尾市| 武邑县| 奎屯市| 锡林郭勒盟| 麻江县| 牟定县| 天柱县| 安新县| 北安市| 扎鲁特旗| 乌兰察布市| 龙岩市| 乌拉特中旗| 中卫市| 阿拉尔市| 江口县| 通化县| 都匀市| 香河县| 南城县| 龙州县| 新巴尔虎左旗| 平和县| 崇左市| 绿春县| 额尔古纳市| 巴马| 焦作市| 科技| 金坛市|