How to close the firewall and ports in centos

王林
Release: 2020-05-16 16:52:35
Original
4794 people have browsed it

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
Copy after login

Close the specified port

The specific commands are as follows:

Check the firewall status and see if it is running

firewall-cmd --state
Copy after login

Close the port

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

Reload to make the previous port setting take effect

firewall-cmd --reload
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template