RedHat Enterprise Linux 7關閉防火牆方法

RedHat Enterprise Linux 7關閉防火牆方法bash

在以前的版本中關閉防火牆等服務的命令是工具

service iptables stop 
/etc/init.d/iptables stop測試

在RHEL7中,其實沒有這個服務.net

[root@rhel7 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.0 (Maipo) 
[root@rhel7 ~]# service iptables stop 
Redirecting to /bin/systemctl stop iptables.service 
[root@rhel7 ~]# /etc/init.d/iptables stop 
-bash: /etc/init.d/iptables: No such file or directory3d

原來在RHEL7開始,使用systemctl工具來管理服務程序,包括了service和chkconfigrest

[root@rhel7 ~]# systemctl list-unit-files|grep enabled | grep firewalld 
firewalld.service enabledblog

禁用防火牆ip

[root@rhel7 ~]# systemctl stop firewalld.service (重啓恢復) 
[root@rhel7 ~]# systemctl disable firewalld.service (永久關閉) 
[root@rhel7 ~]# systemctl status firewalld.service 
firewalld.service – firewalld – dynamic firewall daemon 
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled) 
Active: inactive (dead)虛擬機

啓動一個服務:systemctl start firewalld.service 
關閉一個服務:systemctl stop firewalld.service 
重啓一個服務:systemctl restart firewalld.service 
顯示一個服務的狀態:systemctl status firewalld.service 
在開機時啓用一個服務:systemctl enable firewalld.service 
在開機時禁用一個服務:systemctl disable firewalld.service 
查看服務是否開機啓動:systemctl is-enabled firewalld.service;echo $? 
查看已啓動的服務列表:systemctl list-unit-files|grep enabled 
虛擬機測試 
重啓後驗證it

 

 

https://blog.csdn.net/u011846257/article/details/54707864

相關文章
相關標籤/搜索