在linux中关闭防火墙

在linux中关闭防火墙

selinux(secure linux 安全的linux)
selinux 是linux下的安全措施机制,用来保护linux系统的安全。相当于另外一个安全工具

[root@localhost ~]# getenforce   查看selinux安全策略是否开启
Enforcing
[root@localhost ~]# setenforce 0  设置selinux的安全策略不要强制执行,只是给予提醒
[root@localhost ~]#
[root@localhost ~]# getenforce 
Permissive

#enforcing   表示selinux是强制开启的,linux里的进程在访问文件的时候,会收到selinux策略的影响。
#Permissive  表示selinux是不强制开启,只是记录下与selinux相关的行为,但是不会制止。--》宽容模式
#disabled    表示selinux是关闭的
#在实际的工作中selinux安全机制都是关闭,很少开启。

#关闭selinux的方法:
#1.临时关闭	
[root@localhost ~]# setenforce 0
#2.永久关闭
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled

#编译安装例子里面:
[root@localhost ~]# vim /etc/selinux/config   这个是selinux的配置文件
#     enforcing - SELinux security policy is enforced.  --》默认
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.

#firewalld 防火墙
#firewalld 服务是一个安全工具
#service 方式去停止服务,是centos6或者centos5里常用的方法

[root@localhost ~]# service firewalld stop  立马停止firewalld服务--》立马关闭防火墙服务
Redirecting to /bin/systemctl stop firewalld.service
[root@localhost ~]# which systemctl
/usr/bin/systemctl
[root@localhost ~]# ll /bin
lrwxrwxrwx. 1 root root 7 5月  11 14:34 /bin -> usr/bin
[root@localhost ~]# systemctl stop firewalld 立马停止firewalld服务--》立马关闭防火墙服务 --》影响本次
Redirecting to /bin/systemctl stop firewalld.service

2.systemctl(system control 系统的服务的控制)方式去停止服务是scentos7和centos8新增的方法

[root@localhost ~]# systemctl disable firewalld  设置firewalld开机不要启动--》下次开机启动的时候,不启动这个服务--》影响下次,不影响本次
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]#
#disable 禁用
#enable 开启
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值