CentOS7关闭防火墙方法有哪些-创新互联
这篇文章主要为大家展示了“CentOS7关闭防火墙方法有哪些”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“CentOS7关闭防火墙方法有哪些”这篇文章吧。
隆昌网站制作公司哪家好,找创新互联公司!从网页设计、网站建设、微信开发、APP开发、响应式网站等网站项目制作,到程序开发,运营维护。创新互联公司从2013年开始到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联公司。在之前的版本中关闭防火墙等服务的命令是
service iptables stop
/etc/init.d/iptables stop
在RHEL7中,其实没有这个服务
[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 directory
原来在RHEL7开始,使用systemctl工具来管理服务程序,包括了service和chkconfig
[root@rhel7 ~]# systemctl list-unit-files|grep enabled
cups.path enabled
abrt-ccpp.service enabled
abrt-oops.service enabled
abrt-vmcore.service enabled
abrt-xorg.service enabled
abrtd.service enabled
accounts-daemon.service enabled
atd.service enabled
auditd.service enabled
avahi-daemon.service enabled
bluetooth.service enabled
chronyd.service enabled
crond.service enabled
cups.service enabled
dbus-org.bluez.service enabled
dbus-org.fedoraproject.FirewallD1.service enabled
dbus-org.freedesktop.Avahi.service enabled
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
display-manager.service enabled
dmraid-activation.service enabled
firewalld.service enabled
firstboot-graphical.service enabled
gdm.service enabled
getty@.service enabled
hypervkvpd.service enabled
hypervvssd.service enabled
irqbalance.service enabled
iscsi.service enabled
ksm.service enabled
ksmtuned.service enabled
libstoragemgmt.service enabled
libvirtd.service enabled
lvm2-monitor.service enabled
mdmonitor.service enabled
microcode.service enabled
ModemManager.service enabled
multipathd.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager.service enabled
nfs-lock.service enabled
packagekit-offline-update.service enabled
postfix.service enabled
rhsmcertd.service enabled
rngd.service enabled
rpcbind.service enabled
rsyslog.service enabled
rtkit-daemon.service enabled
smartd.service enabled
spice-vdagentd.service enabled
sshd.service enabled
sysstat.service enabled
systemd-readahead-collect.service enabled
systemd-readahead-drop.service enabled
systemd-readahead-replay.service enabled
tuned.service enabled
vmtoolsd.service enabled
avahi-daemon.socket enabled
cups.socket enabled
dm-event.socket enabled
iscsid.socket enabled
iscsiuio.socket enabled
lvm2-lvmetad.socket enabled
rpcbind.socket enabled
default.target enabled
graphical.target enabled
nfs.target enabled
remote-fs.target enabled
禁用防火墙
[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)
Jul 29 22:25:43 rhel7 systemd[1]: Started firewalld – dynamic firewall daemon.
Jul 29 22:43:29 rhel7 systemd[1]: Stopping firewalld – dynamic firewall daemon…
Jul 29 22:43:29 rhel7 systemd[1]: Stopped firewalld – dynamic firewall daemon.
Jul 29 22:44:14 rhel7 systemd[1]: Stopped firewalld – dynamic firewall daemon.
Jul 29 22:44:15 rhel7 systemd[1]: Stopped firewalld – dynamic firewall daemon.
Jul 29 22:44:19 rhel7 systemd[1]: Starting firewalld – dynamic firewall daemon…
Jul 29 22:44:19 rhel7 systemd[1]: Started firewalld – dynamic firewall daemon.
Jul 29 22:44:21 rhel7 systemd[1]: Stopping firewalld – dynamic firewall daemon…
Jul 29 22:44:21 rhel7 systemd[1]: Stopped firewalld – dynamic firewall daemon.
Jul 29 22:44:32 rhel7 systemd[1]: Stopped firewalld – dynamic firewall daemon.
启动一个服务: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
以上是“CentOS7关闭防火墙方法有哪些”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联-成都网站建设公司行业资讯频道!
名称栏目:CentOS7关闭防火墙方法有哪些-创新互联
网页链接:http://scyanting.com/article/deciei.html