Centos6.5,Centos7分别关闭selinux和防火墙

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是否一致



  • 4
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小崔崔啊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值