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


作者:小崔崔啊
来源:CSDN
原文:https://blog.csdn.net/qq_36527339/article/details/80947076
版权声明:本文为博主原创文章,转载请附上博文链接!

转载于:https://blog.51cto.com/andyboge/2363686

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值