admin 管理员组文章数量: 1086019
在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 开启
本文标签: 在linux中关闭防火墙
版权声明:本文标题:在linux中关闭防火墙 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1686562009a10581.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论