欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Linux开机禁用开启防火墙 有大用

1、# chkconfig --list:显示开机可以自动启动的服务

结果:iptables    0:off    1:off    2:on    3:on    4:on    5:on    6:off表示iptables开机自动开启2、3、4、5级服务。

 

2、# chkconfig --add 命令名: 添加开机自动启动命令名服务

chkconfig --add iptables:开机自动启动iptables服务;

开机后通过命令iptables -L -n校验是否设置成功;

 

3、# chkconfig --del 命令名: 删除开机自动启动命令名服务;

chkconfig --del iptables:开机禁止启动iptables服务;

开机后通过命令iptables -L -n校验是否设置成功

来自 https://www.cnblogs.com/jjzd/p/5721955.html

Linux防火墙iptables的启动与关闭

CentOS7

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

1.关闭firewall

[root@localhost ~]# systemctl stop firewalld.service            //停止firewall
[root@localhost ~]# systemctl disable firewalld.service        //禁止firewall开机启动

2.安装iptables

[root@localhost ~]# yum install iptables-services            //安装


[root@localhost ~]# systemctl restart iptables.service #重启防火墙使配置生效

[root@localhost ~]# systemctl enable iptables.service #设置防火墙开机启动

[root@localhost ~]# systemctl disable iptables.service #禁止防火墙开机启动


CentOS6


[root@localhost ~]# service iptable status      ---查看防火墙状态

[root@localhost ~]#servcie iptables stop           --临时关闭防火墙

[root@localhost ~]#service iptables start          --临时启动防火墙

[root@localhost ~]#service iptables restart          --重启防火墙

[root@localhost ~]#chkconfig iptables off          --永久关闭防火墙

[root@localhost ~]#chkconfig iptables on          --永久开启防火墙

来自 https://blog.csdn.net/bitterliquor/article/details/70256141


Linux关闭防火墙并设置开机开不启动

查看当前状态

[root@xuegod63 ~]# systemctl status firewalld.service    #查看firewalld状态

[root@xuegod63 ~]# systemctl stop firewalld       #关闭

[root@xuegod63 ~]# systemctl start firewalld       #开启

[root@xuegod63 ~]# systemctl disable firewalld     #开机自动关闭   //RHLE7

[root@xuegod63 ~]# chkconfig --list|grep network    #查看开机是否启动   //RHLE6

[root@xuegod63 ~]# systemctl enable firewalld     #开机自动启动

 

2.3  临时和永久关闭Selinux

临时关闭

[root@xuegod63~]# getenforce

Enforcing

[root@xuegod63~]# setenforce 0

setenforce:SELinux is disabled

永久关闭

[root@xuegod63 ~]# vim /etc/selinux/config  

改:7SELINUX=enforcing     #前面的7,表示文档中第7行。方便你查找

为:7SELINUX=disabled

[root@xuegod63 ~]# reboot

 

2.4  设置系统光盘开机自动挂载

[root@xuegod63~]# vim  /etc/fstab  #在文档最后,添加以一下红色内容:

/dev/cdrom                     /mnt                    iso9660 defaults        0 0

[root@xuegod63~]# mount -a

mount:/dev/sr0 写保护,将以只读方式挂载

[root@xuegod63~]# ls /mnt/   #可以查看到此目录下有内容,说明挂载成功

CentOS_BuildTag  GPL      LiveOS    RPM-GPG-KEY-CentOS-7

来自 https://blog.csdn.net/tphou/article/details/79433536


Linux禁止防火墙开机启动

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/tianyuzhixina/article/details/78579687

1.查看防火墙状态


root# service iptables status

2.关闭防火墙,开机会自动启动


root# service iptables stop

3.禁止开机启动


root# chkconfig --del iptables

重启后,
root# iptables -L -n
检查是否设置成功。


来自  https://blog.csdn.net/tianyuzhixina/article/details/78579687

普通分类: