1. 程式人生 > >Centos防火墻&SELINUX關閉及yum源配置

Centos防火墻&SELINUX關閉及yum源配置

entos com all top back etc help fig emc

Centos防火墻及SELINUX關閉

Centos6.x

/etc/init.d/iptables stop
chkconfig iptables off
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config
grep SELINUX=disabled /etc/selinux/config
setenforce 0

Centos7.x

systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config
grep SELINUX=disabled /etc/selinux/config
setenforce 0

Centos配置yum源

centos6.x

cd /etc/yum.repos.d/
\cp CentOS-Base.repo CentOS-Base.repo.$(date +%F)
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
eple源
yum -y install epel-release

centos7.x

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
yum clean all
yum makecache

eple源

 yum -y install epel-release

Centos防火墻&SELINUX關閉及yum源配置