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. (转)即时通讯IM OpenFire源码学习之三:在Eclipse中构建源码

    转:http://blog.csdn.net/huwenfeng_2011/article/details/43412617 源码搭建 下载地址: 地址:http://www.igniterealti ...

  2. C++——数据类型选择

    1.数据类型选择推荐 2.数据类型相关代码注意 2.1 循环的int型注意是int 还是unsigned unsigned a=-1;(a=4294967295)

  3. Linux系统查看局域网的公网ip

    访问http://www.cip.cc即可获得ip 前提是linux系统能够解析域名 [root@Test ~]# curl cip.cc IP : 115.216.41.112 地址 : 中国 浙江 ...

  4. JDK8新特性之方法引用

    什么是方法引用 方法引用是只需要使用方法的名字,而具体调用交给函数式接口,需要和Lambda表达式配合使用. 如: List<String> list = Arrays.asList(&q ...

  5. 搭建WordPress博客程序库

    搭建WordPress博客程序库 wordpress简介 wordpress是一套利用PHP语言和Mysql数据库开发的开源免费的Blog(博客,网站)程序,用户可以在支持PHP环境和Mysql数据库 ...

  6. Mongodb安装遇到的问题

    今天我第一次接触MongoDB,在安装过程中,因为对这个东西不了解,报错了我也不知道是哪里的错,还在网上查了半天资料,后来我懂了,感觉上午就是在浪费时间,是我没睡醒,没睡醒.. 在安装上MongoDB ...

  7. [转]PHP base64_encode 在URL地址参数编码上使用

    因为我使用公钥,使用php的 openssl 加密之后的资料 base64_encode()字符串,然后放入请求 url 中当作参数,urlencode(base64_encode()),然后用 ur ...

  8. map 结构体

    map<node,int> 需要运算符重载< 请注意,不同的node,请务必让它们可以区分出来(node a,b a<b or b<a) 如 node { int a,i ...

  9. [转]mybatis-generator 代码自动生成工具(maven方式)

    由于MyBatis属于一种半自动的ORM框架,所以主要的工作将是书写Mapping映射文件,但是由于手写映射文件很容易出错,mybatis-gennerator插件帮我们自动生成mybatis所需要的 ...

  10. MyBatis是如何使用的?

    MyBatis前身世iBatis本是Apache的一个开源项目,2010年这个项目迁移到google code并改名为MyBatis. 一.高级软件介绍 1.JDK 8 2.Eclipse mars2 ...