美文网首页
centos 7关闭selinux以及防火墙

centos 7关闭selinux以及防火墙

作者: 热血大桃子 | 来源:发表于2019-04-04 19:13 被阅读0次

SELINUX

  • 查看selinux状态
>>> /usr/sbin/sestatus -v
或者
>>> getenforce
  • 临时关闭
>>>  setenforce 0
##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
  • 永久关闭
>>> vim /etc/selinux/config
# 将SELINUX=enforcing改为SELINUX=disabled 
# 设置后需要重启才能生效
>>> reboot

防火墙

  • 永久开启或者关闭防火墙
>>> chkconfig iptables on
>>> chkconfig iptables off
# 重启生效
>>> reboot
  • 临时开启或者关闭防火墙
>>> service iptables start
>>> service iptables stop
# centos7方法 
>>> systemctl start firewalld
>>> systemctl stop firewalld
# 查看状态
>>>  systemctl status firewalld 
# 开机禁用 
>>> systemctl disable firewalld
# 开机启用 
>>> systemctl enable firewalld

相关文章

网友评论

      本文标题:centos 7关闭selinux以及防火墙

      本文链接:https://www.haomeiwen.com/subject/slgqiqtx.html