如何在SimpleHTTPServer的端口8000上連接設備


0

我將繼續閱讀《 Linux的工作原理》一書,並試圖使Python SimpleHTTPServer在其默認端口上運行。我可以訪問本地主機上的主文件夾,但是任何其他嘗試訪問:8000的計算機都超時。

我在路由器中為端口8000啟用了端口轉發,但是nmap返回了輸出

港口國服務原因8000 / tcp過濾的http-alt無響應

將nmap輸出到我的另一台計算機的IP上

港口國服務原因8000 / tcp關閉了http-alt conn-refused

除此之外,我還沒有在IPTables中設置任何規則。

此外,我已經在家庭和工作網絡中都進行了嘗試,完全禁用了家庭路由器的防火牆,但在任何一個網絡上均未成功。

0

Try this: iptables -F and try to connect again to the port 8000, even if you have not changed your firewall, maybe your distro comes with a pre configured firewall. The previous command makes a flush (-F) to the firewall's tables, all chains are cleaned, basically deactivate the firewall.

If you are working with ufw (Uncomplicated Firewall), use the following command: sudo ufw disable for do the same (deactivate the firewall) and try to connect to the port 8000.