Install and use the NTP time synchronization server of ubuntu Server
I. Server
1 apt-Get install NTP
2. The service is started by default after installation. if the service is not started, start it.
/Etc/init. d/NTP start
3 change VI/etc/NTP. conf to the following
Restrict default nomodify notrap noquery
Restrict 127.0.0.1
Restrict 10.91.0.0 mask 255.255.255.0 nomodify
Server 0.pool.ntp.org
Server 1.pool.ntp.org
Server 2.pool.ntp.org
Server 127.127.1.0 # local clock
Fudge 127.127.1.0 stratum 10
Driftfile/var/lib/NTP/drift
Broadcastdelay 0.008
Keys/etc/NTP/keys
4. Restart the NTP service.
/Etc/init. d/NTP restart
Ii. Client
1. Use the ntpdate command. If this command does not exist, install apt-Get install NTP first.
/Usr/sbin/ntpdate 10.91.0.10 // that is, the synchronization time of the NTP server with the IP address 10.91.0.10
2. Set timed synchronization.
VI/etc/crontab
30 01 ***/usr/sbin/ntpdate 10.91.0.10
The system automatically synchronizes the system time to the NTP server At 01:30 every morning.
Of course, the crontab time here refers to the client time, which is equivalent to the NTP server time after synchronization.
NTP time synchronization server