NTP 全称为 Network Time Protocol, 即网络时间协议. 是用来使计算机时间同步的一种协议. 它可以使计算机对服务器或时钟源做同步, 可以提供高精度的时间校正 (LAN 上与标准时间小于 1 毫秒, WAN 上几十毫秒), 而且可以由加密确认的方式防止恶意的协议 ***.
实验环境
两台虚拟机 NTP 时间服务器 192.168.43.57
主机 192.168.43.29
服务端
安装 ntp
yum install -y ntp
编辑配置文件 VIM /etc/ntp.conf
将这行给注释
#restrict default nomodify notrap nopeer noquery
开启 ntp 服务: systemctl start ntpd
客户端
安装 ntp 服务: yum -y install ntp
修改配置文件, 添加上层时间服务器
开启 ntp 服务: service ntpd start
同步时间: ntpdate 192.168.43.57
来源: http://www.bubuko.com/infodetail-3161529.html