Linux 防火墙和SELinux的开启和关闭
防火墙(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的开启和关闭的更多相关文章
- Centos7防火墙和SELinux的开启和关闭
在虚拟机里面开启多个服务,对应多个端口,在防火墙开启的情况下,就要对外开放端口,这样客户端才能正常访问,但比较繁琐,关闭更直接点. 防火墙 临时关闭防火墙 systemctl stop firewal ...
- Linux——防火墙、SELinux规则
一.Firewalld防火墙规则 防火墙的作用:放行或者阻拦某些服务.端口 1.防火墙的简单操作 # 1.查看防火墙状态 systemctl status firewalld # 2.关闭防火墙 sy ...
- CentOS防火墙中端口的开启和关闭
1.开启端口(以80端口为例) 方法一: /sbin/iptables -I INPUT -p tcp --dport -j ACCEPT 写入修改 /etc/init.d/iptables save ...
- linux防火墙和SELinux
1. 关闭防火墙 永久性生效 开启:chkconfig iptables on 关闭:chkconfig iptables off 即时生效 开启:service iptables start 关闭: ...
- 如何应用 AutoIt 修改本机的防火墙配置?(开启,关闭防火墙,添加程序信任到防火墙)
以前,公司的实施人员配置好项目之后,不同的机器之间经常性的无法建立链接,后来发现是防火墙的设置.虽然是个小问题,但是经常性的忘记这个配置. 现在,我决定把对防火墙的设置,加入到我给实施人员的配置工具中 ...
- SpringCloud的应用发布(四)vmvare+linux,防火墙和selinux
一.vmvare网络配置为nat模式 二.vmvare的网络设置为桥接bridge模式 1.linux 网卡的ip获取方式dhcp 三.关闭linux的防火墙和selinux 1.临时关闭防火墙 sy ...
- 网卡配置文件详解 用户管理与文件权限篇 文件与目录权限 软连接 tar解压命令 killall命令 linux防火墙 dns解析设置 计划任务crond服务 软件包安装 阿里云 yum源 安装
Linux系统基础优化及常用命令 Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ...
- linux关闭防火墙及selinux
RHEL6.5 查看linux防护墙状态: service iptables status 关闭linux防火墙: 1)永久关闭,重启后生效 开启: chkconfig iptables on 关闭: ...
- 一 SSH 无密码登陆 & Linux防火墙 & SELinux关闭
如果系统环境崩溃. 调用/usr/bin/vim /etc/profile SHH无密码登陆 所有要做得节点上运行 修改 host name vi /etc/sysconfig/netwo ...
随机推荐
- 【shell编程】之基础知识-函数
linux shell 可以用户定义函数,然后在shell脚本中可以随便调用. shell中函数的定义格式如下: [ function ] funname [()] { action; [return ...
- 比较器(TreeSet和优先队列,可以对里面的元素按照自己的意愿进行排序)
class MyComparator implements Comparator<Integer>{ public int compare(Integer o1, Integer o2) ...
- nginx常用参数设置
1)隐藏nginx header 版本号 使用curl -I http://www.10.0.3.46 会发现server那里显示版本号 在nginx.conf的http里添加参数server_tok ...
- 安装Centos7时提示 /dev/root does not exits
安装centos 7时提示 "Warning: /dev/root does not exist, could not boot" 这个问题是木有找到你的U盘. 在一个能够编辑U盘 ...
- python基础(三)——类的研究
class Employee: //定义类 以冒号结束 '所有员工的基类' //帮助信息 empCount = 0 def __init__(self, name, salary): //调用时初始化 ...
- JDK8新增时间类型用在JPA中的问题
之前数据库存储日期时间类型时一般POJO实体对应属性为java.util.Date,然后通过JPA注解指定它是日期格式或是日期时间格式,JDK8中新增了更好的时间API,如表示本地日期的LocalDa ...
- 99乘法表的正反写 (python的写法)
# 正写 j = 0 k = 0 while j < 10: j+=1 while k <10: k+=1 if j>k: k = 0 break else: print('{}*{ ...
- IDEA基本設置
2.界面字体大小设置 File菜单->Settings->Appearance->Override default fonts by(not recommended):Name:宋体 ...
- js检测字符串的字节数
在js中字符串可以存放数字,字母或者汉字,但是又一个问题就是,数字和字母都是占一个字节,而一个汉字占2个字节.如果在一个字符串中既有字母又有汉字怎么判断字节数呢 第一种简单粗暴 var str = ' ...
- TypeScript 之 声明文件的发布
https://www.tslang.cn/docs/handbook/declaration-files/publishing.html 发布声明文件到npm,有两种方式: 与你的npm包捆绑在一起 ...