- 查看centos版本
cat /etc/redhat-release
- 安裝docker前先關(guān)掉firewalld防火墻
systemctl stop firewalld
- 禁止開機(jī)啟動
firewalld
防火墻
systemctl disable firewalld
4.關(guān)閉seclinux荆忍,重啟 .
getenforce
//查看
cat /etc/selinux/config
永久關(guān)閉 selinux
修改
selinux
的配置文件,重啟后生效眷蜓。
- 打開 selinux 配置文件
[root@localhost ~]# vim /etc/selinux/config
- 修改 selinux 配置文件
將SELINUX=enforcing
改為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=enforcing
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
此時獲取當(dāng)前selinux防火墻的安全策略仍為Enforcing看锉,配置文件并未生效惰瓜。
[root@localhost ~]# getenforce
Enforcing
- 重啟
[root@localhost ~]# reboot
- 驗(yàn)證
[root@localhost ~]# /usr/sbin/sestatus
SELinux status: disabled
[root@localhost ~]# getenforce
Disabled