Home  >  Article  >  Operation and Maintenance  >  How to close the firewall and ports in centos

How to close the firewall and ports in centos

王林
王林Original
2020-05-16 16:52:354690browse

How to close the firewall and ports in centos

Close the firewall

The specific command is as follows:

###关闭防火墙
systemctl stop firewalld.service

###查看防火墙状态
[root@rocketmq-nameserverB ~]# firewall-cmd --state
not running

###禁止firewalld开机启动
systemctl disable firewalld.service

Close the specified port

The specific commands are as follows:

Check the firewall status and see if it is running

firewall-cmd --state

Close the port

firewall-cmd --remove-port=80/tcp --permanent  ##永久移除80端口

Reload to make the previous port setting take effect

firewall-cmd --reload

Recommended tutorial: centos tutorial

The above is the detailed content of How to close the firewall and ports in centos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to shut down centos7Next article:How to shut down centos7