Configuring and using an NTP time server

First, the server

1、vim /etc/ntp.conf                          进入到ntp的配置文件

2, delete all profiles, as long as the following three lines

            restrict default nomodify              不允许客户端登录和修改

            server 127.127.1.0                      使用本地bios时间,自己跟自己同步

    fudge 127.127.1.0 stratum 10     定义级别,越小越精准

Second, the client

1、ntpdate -b 服务器的IP地址              手动时间同步,-b加速初始化

    2、也可加入计划任务中进行自动同步

          crontab -e

          01 * * * * ntpdate 服务器的IP地址

Guess you like

Origin blog.51cto.com/14482279/2428483