首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Centos 8上的开放端口

Centos 8上的开放端口
EN

Stack Overflow用户
提问于 2020-09-24 21:26:28
回答 1查看 8.7K关注 0票数 0

我试图在centos8上本地主机上的端口61009上运行一个服务,但是连接被拒绝了。我试着使用防火墙-cmd命令打开端口。防火墙的输出-cmd-列表-都如下所示。

代码语言:javascript
运行
复制
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources: 
  services: cockpit dhcpv6-client ssh
  ports: 61008-61010/tcp 61022-61024/tcp 61009/tcp
  protocols: 
  masquerade: yes
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

我的操作系统细节如下。

代码语言:javascript
运行
复制
NAME=“CentOS Linux”
VERSION=“8 (Core)”
ID=“centos”
ID_LIKE=“rhel fedora”
VERSION_ID=“8”
PLATFORM_ID=“platform:el8”
PRETTY_NAME=“CentOS Linux 8 (Core)”
ANSI_COLOR=“0;31”
CPE_NAME=“cpe:/o:centos:centos:8”
HOME_URL=“https://www.centos.org/”
BUG_REPORT_URL=“https://bugs.centos.org/”
CENTOS_MANTISBT_PROJECT=“CentOS-8”
CENTOS_MANTISBT_PROJECT_VERSION=“8”

telnet本地主机61009

代码语言:javascript
运行
复制
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

如何在centos8上打开端口?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-09-24 21:38:55

  1. 检查端口状态

netstat -na \ grep 61009

  1. 检查iptable中的端口状态

iptables save\ grep 61009

  1. 添加portvi /etc/services服务-名称端口/协议别名.

防火墙中的

  1. 开放端口-cmd --zone=public -ACCEPT= 61009 / tcp --永久成功#防火墙-cmd--重新加载成功#iptables保存\ grep 61009 -A IN_public_allow -p tcp -m tcp-dport 61009 -m连接-ctstate新-j接受

  1. 检查添加的端口状态

-i -P -P grep http netstat -na grep 61009

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64054649

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档