Centos7新安装系统的配置

新安装的Centos系统需要进行简单优化,配置Ntp,国内yum源,关闭防火墙等服务

一、配置国内yum源:

1、用wget下载repo文件

输入命令

cd /etc/yum.repos.d/ && curl http://mirrors.aliyun.com/repo/Centos-7.repo >> Centos-7.repo

当前目录是/etc/yum.repos.d/,下载的Centos-7.repo也在这个目录中

2、备份系统原来的repo文件并替换系统原理的repo文件

mv CentOS-Base.repo CentOS-Base.repo.bak && mv Centos-7.repo CentOS-Base.repo

即是重命名 Centos-7.repo -> CentOs-Base.repo

3、执行yum源更新命令

yum clean all && yum makecache

yum update  (升级所有软件包,慎用,需要下载很多的软件包,生产环境不要用,风险不可控)

二、配置NTP

yum install ntp -y && systemctl enable ntpd && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && service ntpd restart 

安装Ntp服务并配置时间源为上海

三、关闭防火墙

systemctl disable firewalld && systemctl stop firewalld && systemctl disable NetworkManager && systemctl stop NetworkManager

关闭防火墙并关闭networkmanager服务

四、关闭selinux

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux

 

 

 

posted @ 2020-01-28 12:42  小雨淅淅o0  阅读(546)  评论(0)    收藏  举报