安全連線閘道 - 停用 FTP 連接埠 21

Summary: 如果客戶安全團隊建議禁用用於檔傳輸協定 (FTP) 的埠 21,那是出於安全考慮。埠 21 以純文本形式傳輸數據,使其容易受到攔截和攻擊。禁用此埠有助於防止未經授權的訪問和數據洩露,從而增強對敏感信息的保護。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

  1. 如果必須暫時停用服務:
docker exec -it esrsde-app bash
wd status esrshttpdftp

如果正在執行,請使用下列命令予以停止:

wd stop esrshttpdftp

 

注意:如果閘道重新開機,則會再次啟用 FTP 服務。

 

  1. 如果必須永久停用服務:移除執行容器上的連接埠 21 和 4021:
  2. 如果我們仍在上述步驟的 docker 命令外殼中,我們必須發出 exit 命令以返回 bash 提示符。
  3. 現在我們必須找到容器的連接埠 ID,我們必須使用以下命令進行編輯: 
docker ps --no-trunc
  1. 現在我們必須停止容器,以便使用以下命令進行變更。
docker stop esrsde-app
  1. 現在轉到資料夾: cd /var/lib/docker/containers/<Full port id form step 2>
  2. 建立我們要編輯的檔案的備份:
    1. cp config.v2.json config.v2.json.bak
    2. cp hostconfig.json hostconfig.json.bak
  3. 在移除項目「4021/tcp」config.v2.json修改檔案:{} 
    1. 新項目應如下所示:“ExposedPorts”:{“4443/tcp”:{},“5400/tcp”:{ },
  4. 在移除項目「4021/tcp」hostconfig.json修改檔案:[{“HostIp”:“”,“HostPort”:“21”}],
    1. 新項目應如下所示:“PortBindings”:{“4443(....等等)
  5. systemctl restart docker
  6. docker start esrsde-app
    1. 如果容器無法啟動,則很可能在其中一個檔中錯過了括弧或引號。將備份檔案與新編輯的檔案進行比較,以確認一切正確無誤。
  7. 執行命令來確認連接埠未對應: docker ps

若要從 SCG 主機層級停用 -
如果客戶在 SCG 上,請從 SuSEfirewall2-srs-custom 檔案移除連接埠 21 參照。

  1. cd /etc/sysconfig/scripts/

在修改之前建立備份複本:  

cp SuSEfirewall2-srs-custom SuSEfirewall2-srs-custom.bak
  1. 現在我們編輯 SuSEfirewall2-srs-custom 檔案,並使用 # 註解掉包含以 4021 結尾的 --dport 21 的行,現在看起來應該如下:
    #-A SCG-DOCKER -p tcp -m tcp --dport 21 -j DNAT --to-destination [${srsIpAddr}]:4021
  2. 之後,使用以下命令重新啟動 esrsve.service
    systemctl restart esrsve.service

Affected Products

Secure Connect Gateway - Virtual Edition
Article Properties
Article Number: 000227892
Article Type: How To
Last Modified: 03 Feb 2025
Version:  4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.