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



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章