我是靠谱客的博主 虚拟飞机,这篇文章主要介绍Centos6.5,Centos7分别关闭selinux和防火墙Centos6.5Centos7,现在分享给大家,希望可以做个参考。

Centos6.5

关闭selinux:

永久有效:修改/etc/sysconfig/selinux

将文本中的SELINUX=enforcing,改为SELINUX=disabled。然后重启

即时有效:setenforce  0      

查看状态:getenforce

关闭防火墙:

永久性生效:chkconfig iptables off         ,然后重启

即时生效:service iptables stop

查看防火墙状态:service iptables status  (或者 iptables -L)

检查防火墙是否开机自启:chkconfig iptables  --list (--list这是两个横线)

Centos7

关闭selinux:

永久关闭:编辑/etc/selinux/config

将文本中的SELINUX=enforcing,改为SELINUX=disabled。然后重启

即时有效:setenforce  0      

关闭防火墙:

临时关闭systemctl stop firewalld

防火墙开机关闭systemctl disable firewalld

开机启动systemctl enable firewalld

查看状态systemctl status firewalld

获取 firewalld 状态firewall-cmd --state


###############################################

###############################################

重启网卡systemctl restart network

修改主机名命令hostnamectl set-hostname master

将hadoop的安全模式关了命令:hadoop dfsadmin -safemode leave

*******************************************************************

*******************************************************************

首先看是否设置static如果设置了
输入命令ip addr 查看里边是否有两个ip地址,如果有

systemctl stop NetworkManagersystemctl
systemctl disable NetworkManagersystemctl
systemctl restart network
然后在查看 ip addr 和ifconfig是否一致



最后

以上就是虚拟飞机最近收集整理的关于Centos6.5,Centos7分别关闭selinux和防火墙Centos6.5Centos7的全部内容,更多相关Centos6内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(61)

评论列表共有 0 条评论

立即
投稿
返回
顶部