Centos7新安装系统的配置

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

一、配置国内yum源:

1、用wget下载repo文件

输入命令

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

 

如果wget命令不生效,说明还没有安装wget工具,输入yum -y install wget 回车进行安装。

当前目录是/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 && systemctl enable ntpd && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && sudo 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  阅读(515)  评论(0编辑  收藏  举报