1.yum install ntp ntpdate -y 安装包
1. 配置文件位置为::
vi /etc/ntp.conf
2. 修改配置允许局域网内机器与该服务器进行时间同步。
将下面语句::
restrict default kod nomodify notrap nopeer noquery
修改为::
restrict default nomodify
3. 修改上一层的时间服务器。
ntp.org现在提供NTP POOL PROJECT,即ntp 服务器池项目。在中国区域,配置如下即可::
server 0.cn.pool.ntp.org
server 0.asia.pool.ntp.org
server 2.asia.pool.ntp.org
ntpdate pool.ntp.org 使用命令 同步时间!