Linux防火墙

linux6.x

防火墙会影响通信,默认是拒绝所有。

[root@redhat6 sysconfig]# chkconfig iptables --list
iptables           0:off    1:off    2:on    3:on    4:on    5:on    6:off
[root@redhat6 sysconfig]# service iptables status    //查看防火墙状态
iptables: Firewall is not running.
[root@redhat6 sysconfig]# service iptables start    //启动防火墙
iptables: Applying firewall rules:                         [  OK  ]
[root@redhat6 sysconfig]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
5    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

[root@redhat6 sysconfig]# service iptables stop    //关闭防火墙
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@redhat6 sysconfig]# service iptables status
iptables: Firewall is not running.
[root@redhat6 sysconfig]# chkconfig iptables off    //关闭防护墙开机自启动
[root@redhat6 sysconfig]# chkconfig iptables --list
iptables           0:off    1:off    2:off    3:off    4:off    5:off    6:off
[root@redhat6 sysconfig]#

selinux

selinux 美国NSA国家安全局设计的策略,旨意为将Linux中的文件分类并打标签,让不同的网络服务只能访问自己的文件,其他文件不能访问,这样就算某个服务被攻陷,也不会造成数据全部泄密

-----------------------------

永久关闭selinux

vi /etc/selinux/config

SELINUX=enforcing

改成
SELINUX=disabled

重启

[root@redhat6 ~]# getenforce
Disabled
-----------------------------

[root@redhat6 ~]# setenforce 0  //临时关闭selinux
[root@redhat6 ~]# getenforce
Permissive

[root@redhat6 ~]# chkconfig iptables off  //关闭开机启动selinux

[root@redhat6 ~]# chkconfig iptables --list

天道神诀---防火墙以及selinux(上篇)的更多相关文章

  1. 天道神诀---DHCP服务(上篇)

    DHCP DHCP(Dynamic Host Configuration Protocol, 动态主机配置协议),被应用在局域网环境中,主要作用是集中的管理.分配IP地址,使网路环境中的主机动态的获得 ...

  2. 天道神诀--IPSAN实现多链路以及多路径安装

    # linux6 环境需求 ISCSI服务端: 2张网卡,足够的磁盘空间 iscsi客户端: 2张网卡(与服务端网段相同) ISCSI服务端配置: 与1张网卡配置主要差别在于配置文件中的允许访问网段, ...

  3. 天道神诀--linux双网卡绑定

    # linux6 双网卡绑定操作步骤 1.彻底关闭NetworkManager service NetworkManager stopchkconfig NetworkManager off 2.编辑 ...

  4. 天道神诀--IPSAN(iscsi配置)

    数据存储技术 DSA(Direct Attacted Storage 直接附加存储)本地硬盘 NAS(Network Attacted Storage 网络附加存储)网络服务共享:文件夹 SAN(St ...

  5. 天道神诀--samba和NFS部署

    samba yum -y install samba samba-client rpm -qa |grep samba service smb start(445端口) service nmb sta ...

  6. 天道神诀---FTP服务

    FTP 2种模式 主动模式(默认) 客户端以1024-65535之间某一端口发送指令到服务端的21端口,并建立连接.服务端接受到以后,以20端口去连接客户端,建立一条新的链接并传输数据 被动模式 客户 ...

  7. 天道神诀---DHCP服务(下篇)

    DHCP作用域详解 subnet  定义一个作用域 netmask  定义作用域的掩码 range  允许发放的IP范围 option routers 指定网关地址 option domain-nam ...

  8. Linux关闭防火墙、SELinux

    使用root权限: Linux关闭防火墙: 1. chkconfig –list|grep iptables 2. chkconfig iptables off 永久关闭防火墙 3. chkconfi ...

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

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

随机推荐

  1. EF 关键字

    https://docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/keywords/query-keywords 子句 说明 from ...

  2. PHP面试 PHP基础知识 三(运算符)

    PHP运算符 PHP的运算符的错误控制符@ PHP支持一个错误运算符:@.当将其放在一个PHP表达式之前,该表达式可能产生的任何错误信息都将会被忽略掉. PHP运算符 运算符的优先级 着重记忆运算符 ...

  3. on() 不支持hover事件

    因为 .hover() 是 jQuery 自己定义的事件… 是为了方便用户绑定调用 mouseenter 和 mouseleave 事件而已,它并非一个真正的事件,所以当然不能当做 .bind() 中 ...

  4. std::locale与boost::locale的学习

    1. 什么是facet, locale facet ['fæsɪt]的原意,是宝石切割出来的一个平面. locale[ləʊˈkæl],表示本地化, locale the container that ...

  5. ArabellaCPC 2019

    链接:http://codeforces.com/gym/102263 A: 签到题:A * B . B: 题意:类似取石子游戏,每个人可以取max(1, n(当前剩余) - k)个,最后取完的人赢, ...

  6. Linux操作基础

    摘要 一.Linux操作系统概述 二.Linux操作系统安装 三.Linux文件系统及文件基础 四.Linux操作系统命令使用基础 五.Linux应用程序的安装与卸载基础 五.用户及进程 六.相关信息 ...

  7. 数据整理A

  8. 6-vim-移动命令-01-方向和行内移动

    移动 命令模式下快速移动光标 编辑操作命令与移动命令结合使用 1.上下左右 命令 功能 手指 h 向左 食指 j 向下 食指 k 向上 中指 l 向右 无名指 2.行内移动 命令 英文 功能 w wo ...

  9. 如何在react中实现一个倒计时组件

    倒计时组件 import React, { Component } from 'react' import $ from 'jquery' import "../../css/spellTE ...

  10. Neo4j 小调研

    一. 概况: 在图计算中,基本的数据结构表达式是:G= ( V,E ),V=vertex( 节点 ),E=edge(边) .图数据库中数据模型主要以节点和关系(边)来体现,也可以处理键值对.数据具有如 ...