gpt4 book ai didi

centos - CentOS 开放端口问题

转载 作者:行者123 更新时间:2023-12-04 19:43:37 29 4
gpt4 key购买 nike

我正在使用 CentOS 6 机器。我尝试遵循以下指南:

  • How to open port in centOS
  • http://ask.xmodulo.com/open-port-firewall-centos-rhel.html

  • 如果我运行 nmap ipofmachine在目标机器上我有这个奇怪的结果。
    Host is up (0.0079s latency).
    Not shown: 996 filtered ports
    PORT STATE SERVICE
    22/tcp open ssh
    80/tcp closed http
    443/tcp closed https
    8080/tcp closed http-proxy

    不过,当我运行 sudo iptables -L我有以下输出:
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT tcp -- anywhere anywhere tcp dpt:webcache
    ACCEPT tcp -- anywhere anywhere tcp dpt:webcache
    ACCEPT tcp -- anywhere anywhere tcp dpt:http
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    ACCEPT icmp -- anywhere anywhere
    ACCEPT all -- anywhere anywhere
    ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
    ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
    ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
    ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:webcache
    REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination
    REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    我错过了什么吗?如果您需要更多信息,请告诉我(我正在尝试打开端口 8080)。

    最佳答案

    为了允许特定端口上的连接,您必须配置 CentoOS 防火墙:

    > sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
    > sudo firewall-cmd --reload
  • 您需要使用 sudo
  • 配置权限提升

    关于centos - CentOS 开放端口问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43280159/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com