centos 7关闭selinux以及防火墙

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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。