码迷,mamicode.com
首页 > 系统相关 > 详细

Centos防火墙&SELINUX关闭及yum源配置

时间:2018-10-20 23:52:50      阅读:431      评论:0      收藏:0      [点我收藏+]

标签:配置   init   install   iptable   sed   iptables   com   repos   date   

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源配置

标签:配置   init   install   iptable   sed   iptables   com   repos   date   

原文地址:http://blog.51cto.com/10880347/2306910

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!