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

Linux最小化系统配置

时间:2018-06-27 22:20:03      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:nbsp   isp   tar   分享   版本   /etc   centos 7   工具   repo   

00、操作系统

centos 7 下载地址 https://www.centos.org/download/ 

01、网卡配置

1 cd /etc/sysconfig/network-scripts/
2 vim ifcfg-ens33 #输入到 vim ifcfg-e 再按Tab键
技术分享图片
1 BOOTPROTO="static"
2 BROADCAST=192.168.1.255
3 IPADDR=192.168.1.33
4 NETMASK=255.255.255.0
5 GATEWAY=192.168.1.1
静态IP设置举例

02、测试网络通畅

1 ping www.baidu.com -c 8 #ping 8次

03、更换yum源

  03.1、安装下载工具

1 yum install wget -y 

  03.2、备份当前yum源为阿里源

1 mv /etc/yum.repos.d /etc/yum.repos.d.backup4comex 

  03.3、新建空的yum源设置目录

1 mkdir /etc/yum.repos.d 

  03.4、下载阿里云的yum源配置

1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

  03.5、重建缓存

1 yum clean all
2 yum makecache

   03.6、升级系统组建到最新版本

1 yum -y update

04、NTP校对时间设置

  04.1、设置时区与NTP服务

1 #yum -y install ntp
2 #rm -rf /etc/localtime
3 #ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
4 #/usr/sbin/ntpdate -u ntp.fudan.edu.cn
5 
6 或者用tzselect 来选择时区

  04.2、自动同步

1 #crontab -e 
2 */10 * * * *  /usr/sbin/ntpdate -u ntp.fudan.edu.cn >/dev/null 2>&1
3 #service crond restart

  04.3、临时同步NTP命令

1 ntpdate ntp.fudan.edu.cn

 

Linux最小化系统配置

标签:nbsp   isp   tar   分享   版本   /etc   centos 7   工具   repo   

原文地址:https://www.cnblogs.com/huanu/p/9235558.html

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