关闭Linux防火墙和Selinux

关闭Linux防火墙和禁用selinux

1、临时关闭防火墙

[root@weizhu1 yum.repos.d]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]

iptables: Unloading modules:                               [  OK  ]

2、查看防火墙状态

[root@weizhu1 yum.repos.d]# service iptables status

iptables: Firewall is not running.

3、永久打开防火墙

[root@weizhu1 yum.repos.d]# chkconfig iptables on

4、永久关闭防火墙

[root@weizhu1 yum.repos.d]# chkconfig iptables off

5、临时打开防火墙

[root@weizhu1 yum.repos.d]# service iptables start


禁用selinux

[root@weizhu1 ~]# cd /etc/sysconfig/   #进入目录
[root@weizhu1 sysconfig]# ls                 #查看目录
atd         cgred.conf  grub          ip6tables         irqbalance      netconsole       ntpd        readonly-root  selinux        sysstat.ioconf
auditd      clock       hsqldb        ip6tables-config  kdump           network          ntpdate     rngd           smartmontools  system-config-firewall
authconfig  console     htcacheclean  ip6tables.old     kernel          networking       prelink     rsyslog        snmpd          system-config-firewall.old
autofs      cpuspeed    httpd         iptables          keyboard        network-scripts  quota_nld   samba          snmptrapd      system-config-users
cbq         crond       i18n          iptables-config   libvirt-guests  nfs              raid-check  sandbox        sshd           udev
cgconfig    firstboot   init          iptables.old      modules         nspluginwrapper  readahead   saslauthd      sysstat        wpa_supplicant
[root@weizhu1 sysconfig]# vi selinux   #编辑selinux
[root@weizhu1 sysconfig]# 

SELINUX=disabled                   #禁用selinux



猜你喜欢

转载自blog.csdn.net/weixin_40551559/article/details/80236491