Centos7防火墙常用命令及mask锁定不能添加端口问题
一、开放端口
sudo firewall-cmd --zone=public --add-port=3000/tcp --permanent
sudo firewall-cmd --reload
二、关闭防火墙
//临时关闭防火墙,重启后会重新自动打开
systemctl restart firewalld
//检查防火墙状态
firewall-cmd --state
firewall-cmd --list-all
//Disable firewall
systemctl disable firewalld
systemctl stop firewalld
systemctl status firewalld
//Enable firewall
systemctl enable firewalld
systemctl start firewalld
systemctl status firewalld
三、查看防火墙规则
firewall-cmd --list-all
四、执行 systemctl start firewalld 命令后出现Failed to start firewalld.service: Unit is masked
执行命令,即可实现取消服务的锁定 # systemctl unmask firewalld 下次需要锁定该服务时执行 # systemctl mask firewalld
五。常见问题:
更新了Python版本(version>=Python3),cnetos7系统自带的是Python2.7。
在安装python时,一般教程都会提示说,安装成功后,yum不能用,需要修改yum配置文件(vim /usr/bin/yum)。 把文件头部的#!/usr/bin/python改成#!/usr/bin/python2.7
那么这个方法,继续可以在这个问题上使用:
第一步,vim /usr/bin/firewall-cmd, 将#!/usr/bin/python -Es 改为 #!/usr/bin/python2.7 -Es(到目前为止,上面提到的问题已解决)
第二步,vim /usr/sbin/firewalld, 将#!/usr/bin/python -Es 改为 #!/usr/bin/python2.7 -Es (这一步是针对于防火墙报错,进行的修改)
firewall-cmd --list-ports
Centos7防火墙常用命令及mask锁定不能添加端口问题的更多相关文章
- Centos7防火墙常用命令
有些人安装的linux的系统默认防火墙不是iptables,而是firewall,那就得使用以下方式关闭防火墙了. >>>关闭防火墙 systemctl stop firewalld ...
- Centos7 防火墙常用命令 开启 关闭防火墙
如果你的系统上没有安装使用命令安装 #yum install firewalld //安装firewalld 防火墙 开启服务 # systemctl start firewalld.service ...
- linux下防火墙开启某个端口号及防火墙常用命令使用
linux防火墙常用命令 1.永久性生效,重启后不会复原 开启:chkconfigiptables on 关闭:chkconfigiptables off 2.即时生效,重启后复原 重启防火墙 方式一 ...
- 【CentOS7】常用命令
[CentOS7]常用命令 转载:https://www.cnblogs.com/yangchongxing/p/10646640.html 目录 ========================== ...
- Centos7 防火墙常用配置及说明
一. Centos7和Centos6 防火墙的区别: 使用的工具不一样了.Centos6 使用的是iptables ,Centos7 使用的是filewall iptables 用于过滤数据包,属于网 ...
- iptables防火墙常用命令
iptables防火墙启动停止和基本操作 iptables是centos7之前常用的防火墙,在centos7上使用了firewall 防火墙基本操作: # 查询防火墙状态 service iptabl ...
- Fortigate防火墙常用命令
命令结构 #config 对策略,对象等进行配置 #get 查看相关对象的参数 #show 查看配置文件 #diagnose 诊断命令 #execute 常用的工具命令,如ping treacer ...
- centos6和centos7中常用命令区别
以前一直接触的是centos6,最近因为新项目接触到centos7,发现有些命令还是有差异的(从centos7开始使用systemctl来管理服务和程序,包括了service和chkconfig),现 ...
- firewalld管理防火墙常用命令
1.查看防火墙的状态 [root@localhost HMK]# firewall-cmd --state 查看防火墙的运行状态 not running [root@localhost HMK]# s ...
随机推荐
- RS485 通信接收时丢失0x11等数据
RS485通信接收方,丢弃掉了值为 0x11 的数据. 怀疑 0x11 被转义,没有按照原始数据接收, 查看ASCII码对应表 0x11 代表 “本文结束”, 因此丢弃是有可能的. 要想接收原始数据而 ...
- ubuntu安装 opencv-3.4.3
1 .官网(https://opencv.org/releases.html)下载下源码 opencv-3.4.3.zip 2.解压 unzip opencv-3.4.3.zip 3.cmake c ...
- Laravel 5.2数据库--多个关联关系,带条件约束的渴求式加载的问题
### 今天在连表获取数据的时候,老是获取不到想要的,确实有点无力适从的感觉. 归根到底,还是对laravel不够熟悉,至少是数据库操作那块. ### 问题是这样的: 我想要通过连表中间表,拿中间表的 ...
- tornado的异步效果
第一种方式: import tornado.ioloop import tornado.web from tornado import gen from tornado.concurrent impo ...
- mabytis的xml一些写法
1.jdbcType=TIMESTAMP 而不是 jdbcType=DATETIME myabtis 3.4.6 版本jar包中:jdbcType枚举: ARRAY(Types.ARRAY), BIT ...
- Jenkins二 安装gitlab及其使用
git --version 如果没有安装git直接源码安装即可,如果安装了先删除原来的git. yum -y remove git先安装编译git需要的包. yum install zlib-deve ...
- Confluence 6 导入模板的备注
创建你自己的模板组件(template bundles).你可以使用插件(add-on,也可以被称 plugin)来创建模板组件然后将这些模板组件上传到你的 Confluence 站点中.你可以从你的 ...
- Confluence 6 连接到 Jira 用户管理的建议
建议 如果下面所有的选项都为是的话: JIRA 应用程序不在高负载下运行. 你仅仅希望在一些不多的应用中跨平台管理你的用户和用户组,例如一个 JIRA 软件服务器和 Confluence 服务器,或者 ...
- 一道关于js声明变量,var和let的面试题
function aa(flag) { // var test // 变量提升,函数最顶部 if(flag) { var test = 'hello man' } else { //此处访问 test ...
- 自执行匿名函数: (function() { /* code */ })();
1,常见格式:(function() { /* code */ })(); 2,解释:包围函数(function(){})的第一对括号向脚本返回未命名的函数,随后一对空括号立即执行返回的未命名函数,括 ...