防火墙(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. CSV文件保存为utf8编码格式

    csv格式文件经常用来批量导入数据到某些应用中,但是经常出现utf8乱码问题,那么该如何解决呢? WPS找不到编码格式设置,微软的office软件有,不过我使用的是libreoffice 步骤如下 1 ...

  2. ClusterControl docker 环境搭建

    ClusterControl 是一款比较强大的数据库管理平台,包含了丰富的数据库管理功能. 我们可以用来方便的进行数据管理 测试使用docker-compose 管理 环境准备 docker-comp ...

  3. prime 又一个开源的基于graphql 的cms

    prime 是一个开源的基于graphql 的cms,类似的已经又好多了,strapi 就是一个(graphql 是通过插件扩展的) graphcms 是一款不错的,但是是收费的,prime 是基于t ...

  4. Explicit

    Prefixing the explicit keyword to the constructor prevents the compiler from using that constructor ...

  5. Unity 资源的优化管理 学习

  6. Springboot配置文件映射

    添加类和配置文件的映射: 1.定义映射类 @Component @PropertySource("classpath:config/XX.properties") public c ...

  7. ASP.NET AJAX入门系列(4):使用UpdatePanel控件(一)

    UpdatePanel可以用来创建丰富的局部更新Web应用程序,它是ASP.NET 2.0 AJAX Extensions中很重要的一个控件,其强大之处在于不用编写任何客户端脚本,只要在一个页面上添加 ...

  8. 如何使用Hanlp加载大字典

        问题 因为需要加载一个 近 1G 的字典到Hanlp中,一开始使用了CustomDictionay.add() 方法来一条条的加载,果然到了中间,维护DoubleArraTre 的成本太高,添 ...

  9. 解决openwrt中文界面异常

    openwrt的luci以中文字体显示时,出现以下异常情况: 是因为该固件编译了其他的luci application,我是编译了meshwizard. 可作如下修改: scp登陆打开/usr/lib ...

  10. SDRAM读写操作

    SDRAM读写操作 1.读操作 2.写操作 SDRAM所有时序参数都可以在芯片手册上查到.