温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

CentOS8禁用SELinux的教程

发布时间:2021-08-31 18:05:31 来源:亿速云 阅读:128 作者:chen 栏目:建站服务器

这篇文章主要讲解了“CentOS8禁用SELinux的教程”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“CentOS8禁用SELinux的教程”吧!

如何在CentOS 8上暂时禁用SELinux

在开始在CentOS 8上禁用SELinux之前,请务必先检查SELinux的状态。

为此,请运行以下 命令:

[root@localhost www.linuxidc.com]# sestatus
SELinux status:                enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:        /etc/selinux
Loaded policy name:            targeted
Current mode:                  enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:    allowed
Memory protection checking:    actual (secure)
Max kernel policy version:      31

CentOS8禁用SELinux的教程

这表明SELinux已启动并正在运行。

要暂时禁用SELinux,请运行 命令。

# setenforce 0

另外,您可以运行命令。

# setenforce Permissive

这些命令中的任何一个都将暂时禁用SELinux,直到下次重启为止。

如何在CentOS 8上永久禁用SELinux

现在,让我们看看如何永久禁用SELinux。 SElinux的配置文件位于 /etc/selinux/config。 因此,我们需要对该文件进行一些修改。

# vi /etc/selinux/config

将SELinux属性设置为Disabled,如下所示:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#    enforcing - SELinux security policy is enforced.
#    permissive - SELinux prints warnings instead of enforcing.
#    disabled - No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of these three values:
#    targeted - Targeted processes are protected,
#    minimum - Modification of targeted policy. Only selected processes are protected.
#    mls - Multi Level Security protection.
SELINUXTYPE=targeted

CentOS8禁用SELinux的教程

保存并退出配置文件,然后使用以下任何命令重新启动CentOS 8  Linux系统。

# reboot
# init 0
# telinit 0

现在,使用命令检查SELinux的状态。

[linuxidc@localhost www.linuxidc.com]$ sestatus
SELinux status:                disabled

CentOS8禁用SELinux的教程

SELinux是CentOS 8上非常关键的功能,有助于限制未经授权的用户访问系统上的某些服务。

感谢各位的阅读,以上就是“CentOS8禁用SELinux的教程”的内容了,经过本文的学习后,相信大家对CentOS8禁用SELinux的教程这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI