防火墙(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. day3 python学习

    ---恢复内容开始--- 运算 在Python中有很多种运算方法,我们在这里只是先说比较运算,逻辑运算,赋值运算,算数运算 在这里要记住 ==  判断两个值是否相等  是比较运算符 >= 是否大 ...

  2. 短小而精悍的JsvaScript函数

    1. 回到顶部, 使用浏览器的刷新频率 requestAnimationFrame 来实现的 const scrollToTop = () => { const c = document.doc ...

  3. python通过xlwt模块直接在网页上生成excel文件并下载

    urls: from django.conf.urls import url, include from . import views urlpatterns = [ ... url(r'^domai ...

  4. pyspark数据准备

    鸢尾花数据集 5.1,3.5,1.4,0.2,Iris-setosa 4.9,3.0,1.4,0.2,Iris-setosa 4.7,3.2,1.3,0.2,Iris-setosa 4.6,3.1,1 ...

  5. Python中的数组和list

    Python的X[y==1, 0] 最近研究逻辑回归,Iris花的经典示例,代码就不全粘贴了,具体代码参看“Iris花逻辑回归与实现” plt.plot(X[y==0, 0], X[y==0,1], ...

  6. MongoDB从3.0.6升级到MongoDB3.4.9

    最初进入公司的时候,有些爬虫数据需要存储在mongo数据库里面,当时看到最新的数据库版本是3.0.6,现在公司开展了新的项目需要使用到Mongo,使用到了Mongo的一些表关联查询的方法,但是只有在最 ...

  7. google浏览器查看源码快捷键 ctrl+U

    google浏览器查看源码快捷键 ctrl+U 或则在地址栏的网址前加上:view-source:

  8. Linux之异步通知机制分析

    1.概念: 异步通知机制:一旦设备就绪,则主动通知应用程序,这样应用程序根本就不需要查询设备状态,是一种“信号驱动的异步I/O”.信号是在软件层次上对中断机制的一种模拟,在原理上,一个进程收到一个信号 ...

  9. 编写dll时的内存分配策略

    前一篇文章介绍了为何要共用内存管理器,有人要问可不可以在编写dll时更通用一些,可以兼顾其它编译器(如果是其它编译器的话,Delphi写的dll不能与其它语言共用内存管理器),采用一定的策略来避免在d ...

  10. 写了一个hiero检查任务渲染结果的脚本

    基本思路是写了一个时间判断函数(postSequence_check)来对比transcode任务提交时间和目标文件夹内文件的修改时间来确定渲染是否成功执行,然后通过Hiero提供的postSeque ...