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

Centos6.5
关闭selinux:
永久有效:修改/etc/sysconfig/selinuxlinux

将文本中的SELINUX=enforcing,改成SELINUX=disabled。而后重启安全

即时有效:setenforce  0      ide

查看状态:getenforceoop

关闭防火墙:
永久性生效:chkconfig iptables off         ,而后重启.net

即时生效:service iptables stoprest

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

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

Centos7
关闭selinux:
永久关闭:编辑/etc/selinux/confighadoop

将文本中的SELINUX=enforcing,改成SELINUX=disabled。而后重启ci

即时有效: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 版权声明:本文为博主原创文章,转载请附上博文连接!

相关文章
相关标签/搜索