Ubuntuserverntp time synchronization server installation and use 1. after the server 1apt-getinstallntp2 is installed, the service is started by default. if the server is not started, start it. /Etc/init. d/ntpstart3vi/etc/ntp. conf to restrictdefaultn...
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.
Gg296231363 column