Simple time synchronization with remote ntp server

Install ntp server:

apt install -y ntp

Reading package lists... Done
Building dependency tree        
Reading state information... Done
The following additional packages will be installed:
Suggested packages:
The following NEW packages will be installed:
 libopts25 ntp
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 667 kB of archives.
After this operation, 2019 kB of additional disk space will be used.
Do you want to continue? [Y/n]  
Get:1 stretch/main amd64 libopts25 amd64 1:5.18.12-3 [68.0 kB]
Get:2 stretch/main amd64 ntp amd64 1:4.2.8p10+dfsg-3+deb9u2 [599 kB]
Fetched 667 kB in 3s (181 kB/s)
Selecting previously unselected package libopts25:amd64.
(Reading database ... 42738 files and directories currently installed.)
Preparing to unpack .../libopts25_1%3a5.18.12-3_amd64.deb ...
Unpacking libopts25:amd64 (1:5.18.12-3) ...
Selecting previously unselected package ntp.
Preparing to unpack .../ntp_1%3a4.2.8p10+dfsg-3+deb9u2_amd64.deb ...
Unpacking ntp (1:4.2.8p10+dfsg-3+deb9u2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for systemd (232-25+deb9u9) ...
Setting up libopts25:amd64 (1:5.18.12-3) ...
Processing triggers for man-db ( ...
Setting up ntp (1:4.2.8p10+dfsg-3+deb9u2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for systemd (232-25+deb9u9) ...

Edit config file and remove pool entries and add server entries:

# You do need to talk to an NTP server or two (or three). 
# maps to about 1000 low-stratum NTP servers.  Your server will
# pick a different set every time it starts up.  Please consider joining the
# pool: <>
#pool iburst
#pool iburst
#pool iburst
#pool iburst

Restart ntp service:

systemctl restart ntp

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *

This site uses Akismet to reduce spam. Learn how your comment data is processed.