頭條資訊 - 為您提供最新最全的新聞資訊,每日實時更新

詳解ACL限制SSH、Telnet遠程登錄及抓包實驗

科技數碼 精彩網絡技術

詳解ACL限制SSH、Telnet遠程登錄及抓包實驗

組網要求SW2、SW3交換機與SW1連接,為了保證核心交換機SW1的安全,要求在SW1上配置SSH,允許SW2通過遠程登錄,不允許其他交換機遠程登錄。在SW2上配置Telnet,允許PC1遠程登錄。

一、eNSP實際操作視頻:

二、主要知識點:

Telnet缺少安全的認證方式,而且傳輸過程採用TCP進行明文傳輸,存在很大的安全隱患。單純提供Telnet服務容易招致DoS(Deny of Service)、主機IP地址欺騙、路由欺騙等惡意攻擊。

隨著人們對網絡安全的重視,傳統的Telnet和FTP通過明文傳送密碼和數據的方式,已經慢慢不被人接受。SSH(Secure Shell)是一個網絡安全協議,通過對網絡數據的加密,解決了這個問題。它在一個不安全的網絡環境中,提供了安全的遠程登錄和其他安全網絡服務。

SSH通過TCP進行數據交互,它在TCP之上構建了一個安全的通道。另外SSH服務除了支持標準端口22外,還支持其他服務端口,以防止受到非法攻擊。

STelnet

STelnet是基於SSH的安全Telnet服務。與Telnet相比,SSH服務器通過對客戶端進行認證及雙向的數據加密,為網絡終端訪問提供了安全的服務。

三、IP設置:

PC1:192.168.10.10/24

SW1:vlanif1:192.168.10.1/24

SW2:vlanif1:192.168.10.2/24

SW3:vlanif1:192.168.10.3/24

四、SW1的主要配置文件:

#

sysname SW1

#

acl number 2000

rule 5 permit source 192.168.10.2 0

#

aaa

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default

domain default_admin

local-user admin password simple admin

local-user admin service-type http

local-user sshsw1 password cipher %NS[+B0ZNI]NZPO3JBXBHA!! #創建SSH用戶,用戶名為:sshsw1,配置的密碼為123456

local-user sshsw1 privilege level 15  #sshsw1的權限為15級為最高級

local-user sshsw1 service-type ssh #本地用戶的服務類型為ssh

#

interface Vlanif1

ip address 192.168.10.1 255.255.255.0

#

stelnet server enable #啟用Stelnet服務

ssh user sshsw1

ssh user sshsw1 authentication-type password #ssh的認證類型為密碼認證

ssh user sshsw1 service-type stelnet #ssh的服務類型為stelnet

#

rsa local-key-pair create #生成本地秘鑰對 ,當其他交換機第一次訪問時,要在客戶機上執行ssh client first-time enable 命令,下載秘鑰

#

user-interface con 0

user-interface vty 0 4

acl 2000 inbound   #只允許訪問控制列表允許的源地址訪問用戶界面,其他默認的被拒絕

authentication-mode aaa #用戶界面的認證方式為aaa

protocol inbound ssh #訪問的協議為ssh

#

return

五、SW2的主要配置文件:

#

sysname SW2

#

acl number 2000

rule 5 permit source 192.168.10.10 0

#

aaa

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default

domain default_admin

local-user admin password simple admin

local-user admin service-type http

local-user telsw2 password cipher %NS[+B0ZNI]NZPO3JBXBHA!!

local-user telsw2 privilege level 15

local-user telsw2 service-type telnet

#

interface Vlanif1

ip address 192.168.10.2 255.255.255.0

#

user-interface con 0

user-interface vty 0 4

acl 2000 inbound

authentication-mode aaa

#

return

六:驗證結果

1、在SW2上遠程登錄SW1

[SW2]stelnet 192.168.10.1

Please input the username:sshsw1

Trying 192.168.10.1 ...

Press CTRL+K to abort

Connected to 192.168.10.1 ...

The server's public key does not match the one catched before.

The server is not authenticated. Continue to access it? [Y/N]:y

Update the server's public key now? [Y/N]:

Dec 29 2020 13:43:45-08:00 SW2 %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[0]:The server h

ad not been authenticated in the process of exchanging keys. When deciding wheth

er to continue, the user chose Y.y

Dec 29 2020 13:43:46-08:00 SW2 %%01SSH/4/UPDATE_PUBLICKEY(l)[1]:When deciding wh

ether to update the key 192.168.10.1 which already existed, the user chose Y.

Enter password:

Info: The max number of VTY users is 5, and the number

of current VTY users on line is 1.

The current login time is 2020-12-29 13:43:50.

2、在SW3上遠程登錄SW2

telnet 192.168.10.2

Trying 192.168.10.2 ...

Press CTRL+K to abort

因為SW2做了ACL,只允許PC1遠程登錄。

轉載請超鏈接註明:頭條資訊 » 詳解ACL限制SSH、Telnet遠程登錄及抓包實驗
免責聲明
    :非本網註明原創的信息,皆為程序自動獲取互聯網,目的在於傳遞更多信息,並不代表本網贊同其觀點和對其真實性負責;如此頁面有侵犯到您的權益,請給站長發送郵件,並提供相關證明(版權證明、身份證正反面、侵權鏈接),站長將在收到郵件24小時內刪除。
加載中...