zoukankan      html  css  js  c++  java
  • Systemd 入门教程:实战篇。selinx,防火墙

    http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html

    关闭selinux:

    临时:setenforce 0

    彻底关闭:

    vim /etc/sysconfig/selinux ,讲selinux=enforcing修改为:selinux=disable,重启系统

    CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下

    1、直接关闭防火墙

    systemctl stop firewalld.service #停止firewall

    systemctl disable firewalld.service #禁止firewall开机启动

    2、设置 iptables service

    yum -y install iptables-services

    如果要修改防火墙配置,如增加防火墙端口3306

    vi /etc/sysconfig/iptables 

    增加规则

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

    保存退出后

    systemctl restart iptables.service #重启防火墙使配置生效

    systemctl enable iptables.service #设置防火墙开机启动

    最后重启系统使设置生效即可。

  • 相关阅读:
    如何找回Oracle所有用户丢失的密码
    数据库范式详解
    lua
    cdn
    初心
    广州
    vim 命令
    git 命令
    Linux琐碎
    汪国真语录
  • 原文地址:https://www.cnblogs.com/shanwater/p/6847337.html
Copyright © 2011-2022 走看看