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. Go语言中接口组合的实现方法

    在Go语言中,可以在接口A中组合其它的一个或多个接口(如接口B.C),这种方式等价于在接口A中添加接口B.C中声明的方法. 代码如下: //接口中可以组合其它接口,这种方式等效于在接口中添加其它接口的 ...

  2. yield列表反转 islice切片(2.6)

    yield列表反转 islice切片 列表反转 l1 = [i for i in range(10)] print(l1) print(l1[::2]) l1.reverse() # 注: pytho ...

  3. 入门级_Tensorflow网络搭建

    Tensorflow如何搭建神经网络 1.基本概念 基于Tensorflow的神经网络:用张量表示数据,用计算图搭建神经网络,用会话执行计算图,优化线上的权重(参数),得到模型 张量:张量就是多维数据 ...

  4. error LNK2001: 无法解析的外部符号 __imp__MessageBoxA@16

    错误: error LNK2001: 无法解析的外部符号 __imp__MessageBoxA@16 原因: 本来程序的编译选项选择的是:使用标准windows库,当改为在静态库中使用MFC后就出现了 ...

  5. Redis数据结构之字符串-SDS

    C语言中,传统的字符串表示是以空字符结尾的字符数组,Redis的字符串没有直接使用该表示,而是选择构建了一种名为简单动态字符串(simple dynamic string, SDS)的抽象类型. 在R ...

  6. 8-MySQL-Ubuntu-数据表中数据的增加(一)

    增(insert) (1)全部字段插入数据:按表中字段顺序增加数据 注:(1)主键字段可以使用0/null/default来占位.(2)gender字段中数据类型是枚举,可以使用索引数字1,2,3,4 ...

  7. AXD 的使用以及源代码说明

    汇编源代码说明 ;=============================================================================== ;  引用头文件 ;= ...

  8. 关于apache 重定向设定

    本人在研究关于apache重定向的资料,在网上找了很多,但是就本人来说,方便理解的,找到了这么一个,记录了下来,原帖地址:http://www.exehack.net/8.html 关于apache配 ...

  9. 2018阿里云云数据库RDS核心能力演进

    摘要: 2018年云数据库RDS发展上,不但针对MySQL.SQL Server.PostgreSQL提供了适合个人入门用户的基础版产品,以实惠的价格普惠广大中小用户.更加入最新的MariaDB TX ...

  10. NX二次开发-UFUN读取图纸尺寸的值UF_DRF_ask_dimension_text

    今天发现UF_DRF_ask_dim_info这个函数不能读带附件文本的尺寸,有附加文本dim_info->text_info->text->full_string;读出来的是附加文 ...