iptables防火墙和selinux
iptables
存在以下两种方式:
一、service方式
查看防火墙状态:
[root@centos6 ~]# service iptables status
iptables:未运行防火墙
开启防火墙: [root@centos6 ~]# service iptables start
关闭防火墙: [root@centos6 ~]# service iptables stop
二、iptables方式
先进入init.d目录,命令如下:
[root@centos6 ~]# cd /etc/init.d/
[root@centos6 init.d]#
然后 查看防火墙状态:
[root@centos6 init.d]# /etc/init.d/iptables status
暂时关闭防火墙:
[root@centos6 init.d]# /etc/init.d/iptables stop
重启iptables:
[root@centos6 init.d]# /etc/init.d/iptables restart
selinux
临时生效: getenforce 0
永久生效: 改配置文件 /etc/sysconfig/selinux
[root@oldboy /]# vi /etc/sysconfig/selinux
把SELINUX=enforcing 改成 disabled [root@oldboy /]# cat /etc/sysconfig/selinux # This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
iptables防火墙和selinux的更多相关文章
- 关闭SELinux和iptables防火墙
1.关闭SELinux: 编辑SELinux配置文件: [root@Redis selinux]# vim /etc/selinux/config 修改SELINUX配置项为disable SELIN ...
- 2-10~2-11 配置iptables防火墙增强服务 selinux简单讲解
学习一个服务的过程: 1.此服务器的概述:名字,功能,特点,端口号 2.安装 3.配置文件的位置 4.服务启动关闭脚本,查看端口 5.此服务的使用方法 6.修改配置文件,实战举例 7.排错(从下到上, ...
- Centos7 iptables firewalld防火墙与selinux配置
一.iptables防火墙 1.基本操作 # 查看防火墙状态 service iptables status # 停止防火墙 service iptables stop # 启动防火墙 service ...
- Linux关闭防火墙、SELinux
使用root权限: Linux关闭防火墙: 1. chkconfig –list|grep iptables 2. chkconfig iptables off 永久关闭防火墙 3. chkconfi ...
- linux关闭防火墙及selinux
RHEL6.5 查看linux防护墙状态: service iptables status 关闭linux防火墙: 1)永久关闭,重启后生效 开启: chkconfig iptables on 关闭: ...
- Linux学习笔记 --iptables防火墙配置
iptables防火墙配置 一.防火墙简介 1.功能: 1)通过源端口,源IP地址,源MAC地址,包中特定标记和目标端口,IP,MAC来确定数据包是否可以通过防火墙 2)分割内网和外网[附带的路由器的 ...
- iptables防火墙配置
iptables防火墙配置 一.防火墙简介 1.功能: 1)通过源端口,源IP地址,源MAC地址,包中特定标记和目标端口,IP,MAC来确定数据包是否可以通过防火墙 2)分割内网和外网[附带的路由器的 ...
- Centos7下安装iptables防火墙
说明:centos7默认使用的firewalld防火墙,由于习惯使用iptables做防火墙,所以在安装好centos7系统后,会将默认的firewall关闭,并另安装iptables进行防火墙规则设 ...
- linux防火墙和SELinux
1. 关闭防火墙 永久性生效 开启:chkconfig iptables on 关闭:chkconfig iptables off 即时生效 开启:service iptables start 关闭: ...
随机推荐
- Ruby 写文件
Ruby 写文件 outFile = File.new("fileName.txt","w") outFile.puts "a" outFi ...
- UVa 10465 Homer Simpson(DP 全然背包)
题意 霍默辛普森吃汉堡 有两种汉堡 一中吃一个须要m分钟 还有一种吃一个须要n分钟 他共同拥有t分钟时间 要我们输出他在尽量用掉全部时间的前提下最多能吃多少个汉堡 假设时间无法用 ...
- hdoj 1518 Square 【dfs】
题意:给出n个(不同长度的)棍子,问能不能将他们构成一个正方形. 策略:深搜. hdoj 1455的简化版 代码: #include <stdio.h> #include <stri ...
- MongoDB 索引的使用, 管理 和优化
MongoDB 索引的使用, 管理 和优化 2014-03-25 17:12 6479人阅读 评论(0) 收藏 举报 分类: MongoDB(9) [使用explain和hint] 前面讲高级查询 ...
- Getting started with ASP.NET Core MVC and Visual Studio
This tutorial will teach you the basics of building an ASP.NET Core MVC web app using Visual Studio ...
- 获取android的SDK或者手机目录路径
获取android的SDK或者手机目录路径 Google为我们提供了API来获取SDK或者手机目录路径: 1.获取SD卡目录 File file1 = Environment.getExternalS ...
- Maven打包编译错误工作区间设置编码格式gbk可以utf-8不可以
转自:https://blog.csdn.net/wolf_love666/article/details/52593483 问题:Maven打包编译错误工作区间设置编码格式gbk可以utf-8不可以 ...
- hammer教程
一.前言 移动端框架当前还处在初级阶段,但相对于移动端的应用来说已经有很长时间了.虽然暂时还没有PC端开发的需求量大,但移动端的Web必然是一种趋势,在接触移动端脚本的过程中,最开始想到的是juqer ...
- JS函数种类详解
1. 普通函数1.1 示例 1 2 3 function ShowName(name) { alert(name); } 1.2 Js中同名函数的覆盖 在Js中函数是没有重载,定义相同函数名.不同 ...
- Linux Shell Scripting Cookbook 读书笔记 7
ping, du, ps, kill, 收集系统信息 判断网络中哪些主机是活动主机 #!/bin/bash for ip in 10.215.70.{1..255}; do ( ping $ip -c ...