防火墙(firewalld)

  • 临时关闭防火墙
    systemctl stop firewalld
  • 永久防火墙开机自关闭
    systemctl disable firewalld
  • 临时打开防火墙
    systemctl start firewalld
  • 防火墙开机启动
    systemctl enable firewalld
  • 查看防火墙状态
    systemctl status firewalld
[root@localhost ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: ena bled)
Active: active (running) since Sat 2017-04-08 10:36:57 CST; 31s ago
Main PID: 2856 (firewalld)
CGroup: /system.slice/firewalld.service
└─2856 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid Apr 08 10:36:56 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewal....
Apr 08 10:36:57 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

SELinux

  • 临时关闭SELinux
    setenforce 0
  • 临时打开SELinux
    setenforce 1
  • 查看SELinux状态
    getenforce
  • 开机关闭SELinux
    编辑/etc/selinux/config文件,如下图,将SELINUX的值设置为disabled。下次开机SELinux就不会启动了。

注意,此时也不能通过setenforce 1命令临时打开。

[root@localhost ~]# setenforce 1
setenforce: SELinux is disabled
  • 1
  • 2

需要修改配置文件,然后重启linux后,才可以再打开SELinux

Linux 防火墙和SELinux的开启和关闭的更多相关文章

  1. Centos7防火墙和SELinux的开启和关闭

    在虚拟机里面开启多个服务,对应多个端口,在防火墙开启的情况下,就要对外开放端口,这样客户端才能正常访问,但比较繁琐,关闭更直接点. 防火墙 临时关闭防火墙 systemctl stop firewal ...

  2. Linux——防火墙、SELinux规则

    一.Firewalld防火墙规则 防火墙的作用:放行或者阻拦某些服务.端口 1.防火墙的简单操作 # 1.查看防火墙状态 systemctl status firewalld # 2.关闭防火墙 sy ...

  3. CentOS防火墙中端口的开启和关闭

    1.开启端口(以80端口为例) 方法一: /sbin/iptables -I INPUT -p tcp --dport -j ACCEPT 写入修改 /etc/init.d/iptables save ...

  4. linux防火墙和SELinux

    1. 关闭防火墙 永久性生效 开启:chkconfig iptables on 关闭:chkconfig iptables off 即时生效 开启:service iptables start 关闭: ...

  5. 如何应用 AutoIt 修改本机的防火墙配置?(开启,关闭防火墙,添加程序信任到防火墙)

    以前,公司的实施人员配置好项目之后,不同的机器之间经常性的无法建立链接,后来发现是防火墙的设置.虽然是个小问题,但是经常性的忘记这个配置. 现在,我决定把对防火墙的设置,加入到我给实施人员的配置工具中 ...

  6. SpringCloud的应用发布(四)vmvare+linux,防火墙和selinux

    一.vmvare网络配置为nat模式 二.vmvare的网络设置为桥接bridge模式 1.linux 网卡的ip获取方式dhcp 三.关闭linux的防火墙和selinux 1.临时关闭防火墙 sy ...

  7. 网卡配置文件详解 用户管理与文件权限篇 文件与目录权限 软连接 tar解压命令 killall命令 linux防火墙 dns解析设置 计划任务crond服务 软件包安装 阿里云 yum源 安装

    Linux系统基础优化及常用命令 Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ...

  8. linux关闭防火墙及selinux

    RHEL6.5 查看linux防护墙状态: service iptables status 关闭linux防火墙: 1)永久关闭,重启后生效 开启: chkconfig iptables on 关闭: ...

  9. 一 SSH 无密码登陆 & Linux防火墙 & SELinux关闭

    如果系统环境崩溃.   调用/usr/bin/vim /etc/profile   SHH无密码登陆 所有要做得节点上运行   修改 host name vi /etc/sysconfig/netwo ...

随机推荐

  1. 【BZOJ1452】【JSOI2009】count

    暴力出奇迹……原题: 图片题面好评(图片样例差评 我最开始的思路: 容斥,变成每次询问((1,1),(x,y))这个矩阵中颜色为c的个数,然后三维偏序!cdq分治! 但是2e5的询问好像并不大丈夫?乘 ...

  2. Centos7——selinux配置

    临时关闭selinux setenforce 0 永久关闭selinux vi /etc/selinux/config 修改enforcing为disabled 情景一: httpd修改网站文件目录的 ...

  3. vernemq 集群 docker-compose 搭建简单试用

    vernemq 是一款开源的mqtt broker, 支持cluster 模式部署,而且部署比较简单 以下是一个使用docker-compose 搭建环境的demo 环境准备 docker-compo ...

  4. MySQL聚合函数与数据分组

    我们最常需要的是汇总数据而不是把他们实际检索出来 确定表中行数(或满足某个条件或包含某个特定值的行数) 确定表中行组的和 找出表列(或所有行或特定列)的最大值,最小值和平均值 聚集函数是运行在行组上, ...

  5. es高级部分

    1 关于机器 配置. 内存:上亿的数据一般需要64G内存的服务器.劲量不要使用小于32G 内存的服务器. cpu:es 对cpu 要求依赖不如内存.一般要求2-8 核就可以了. 磁盘:es 对磁盘依赖 ...

  6. 如何编译运行HanLP自然语言处理包

    master分支 对于master分支,编译方法如下: git clone  https://github.com/hankcs/HanLP.git mvn install -DskipTests · ...

  7. C#:decimal的去0显示

    public static string DecimalToString(decimal d) { return d.ToString("#0.######"); } 后面的0会给 ...

  8. php上传导入文件 nginx-502错误

    4. php程序执行时间过长而超时,检查nginx和fastcgi中各种timeout设置.(nginx 中的  fastcgi_connect_timeout 300;fastcgi_send_ti ...

  9. php解析url并得到url中的参数及获取url参数

    <?php $url = 'http://www.baidu.com/index.php?m=content&c=index&a=lists&catid=6&ar ...

  10. Excel技巧--分类求和与空白批量填充

    分类求和: 当我们要对以上多个分类空白求和时,可以巧用Alt+=键: 1.选择对应要求和的列: 2.点击“查找与选择”下拉列,选择“定位条件”,对话框选择“空值”,点确定.将列中的空白单元格选好: 3 ...