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. CentOS7简单安装mplayer和vlc!

    http://pkgs.org/在这个网上搜索下面的包的最新版1. sudo rpm -ivh epel-release-7-0.2.noarch.rpm 2. sudo rpm -Uvh elrep ...

  2. 项目管理模式:外瀑布内敏捷(有人称为“信封法”)--转自知乎大神:CORNERSTONE

    作者:CORNERSTONE 链接:https://www.zhihu.com/question/265968122/answer/878124580 来源:知乎 著作权归作者所有.商业转载请联系作者 ...

  3. java.lang.Object错误

    java.lang.Object错误 项目遇到一个错误 因为构建路径不完整..... 主要是因为缺少JDK(java.lang.Object来自那里),或者是JDK错误. 右击项目-->属性-- ...

  4. git分布式版本控制系统权威指南学习笔记(一):配置文件、简单流程和小问题

    文章目录 git配置文件简介 git config各种命令 配置级别: 用户信息 文本编辑器 差异分析工具 配置命令别名 公钥 git协同流程 简单流程 初始化版本库 提交至缓存区 查看状态 提交分支 ...

  5. REST Client实际应用记录

    请求Content-Type为application/x-www-form-urlencoded 先来看一个完整示例: ############## ### qa问答 @msg="糖尿病患者 ...

  6. Delphi(ObjectPascal)基础语法

      一个程序分为两个部分:1.程序首部:program 来标识这是一个pascal程序  后面的是可执行文件的名称程序名称2.程序体:说明部分:数据先定义后使用执行部分:以begin开始,以end结束 ...

  7. zookeeper 同一docker伪集群

    1).集群目录 cd /usr/local/zookeeper01/data touch myid vi  输入 cd /usr/local/zookeeper01/data touch myid v ...

  8. vue keep-alive缓存问题

    搬运自:https://blog.csdn.net/dongguan_123/article/details/80910231 我的问题:列表页  > 详情页a  > 支付页  >  ...

  9. window 对象常见的事件

    1.页面加载事件 方式1:window.onload = function(){ } window.addEventListener('load',function(){ }) window.onlo ...

  10. ros机器人导航设置原点,目标点

    之前利用movebase导航定位都是通过rviz用鼠标指来指去,实验时非常方便,但实际应用总不能也人工指来指去吧,这怎么体现智能呢 启动导航后,用以前使用的rviz设设置目标点来获取map坐标系下的位 ...