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:
 libopts25
Suggested packages:
 ntp-doc
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 http://ftp.pl.debian.org/debian stretch/main amd64 libopts25 amd64 1:5.18.12-3 [68.0 kB]
Get:2 http://ftp.pl.debian.org/debian 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 (2.7.6.1-2) ...
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). 
server ntp.nask.pl
# pool.ntp.org 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: <http://www.pool.ntp.org/join.html>
#pool 0.debian.pool.ntp.org iburst
#pool 1.debian.pool.ntp.org iburst
#pool 2.debian.pool.ntp.org iburst
#pool 3.debian.pool.ntp.org 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.