Pāriet uz saturu

NTP servera konfigurēšana Mediation Controller serverī

NTP servera izmantošana ļauj sinhronizēt jūsu datoru pulksteņus ar NTP servera pulksteni.
Šajā dokumentācijā ir aprakstīta NTP servera konfigurēšana CyberElements Bastion Mediation Controller serverim.

Priekšnosacījumi

Ir nepieciešama SSH vai konsoles piekļuve + iespēja datorā izmantot superlietotāja kontu. Turklāt jums ir jāpārliecinās, ka Mediation Controller serverī ir atvērts UDP ports 123 uz vajadzīgo NTP serveri(-iem).

CyberElements Bastion Mediation Controller servera NTP servera(-u) konfigurācija tiek iestatīta failā /etc/ntpsec/ntp.conf. Pēc noklusējuma kā NTP serveri tiek izmantoti Debian serveri.

Lai pielāgotu izmantojamo(-s) NTP serveri(-us), vispirms rindās 34–37 pārvērtiet komentārā (pievienojiet # rindas sākumā) Debian NTP serveru izmantošanu:

31
32
33
34
35
36
37
# 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

Pēc tam, sākot ar 27. rindu, pievienojiet vienu vai vairākus NTP serverus. Katrā rindā jāpievieno viens serveris šādā formātā: server IP_ou_DNS_NTP.

Piemērs

Lai izmantotu serverus ntp1.systancia.local un 172.16.20.20, fails būtu jāmaina šādi:

26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Specify one or more NTP servers.
server ntp1.systancia.local
server 172.16.20.20

# Public NTP servers supporting Network Time Security:
# server time.cloudflare.com nts

# 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

Informācija

Plašāku informāciju par faila konfigurēšanu var iegūt ar komandu man ntp.conf.

Brīdinājums!

Ja definējat mazāk nekā 3 NTP serverus, parametrs minsane 24. rindā ir jāsamazina līdz NTP serveru skaitam.
Bez šīs izmaiņas ntpsec nelabos datora laiku.

Piemērs

Ja ir definēts tikai viens NTP serveris, 24. rinda ir jāmaina tā, lai minsane vērtība būtu 1:

24
tos minclock 4 minsane 1

Izmantojot iepriekš minēto konfigurācijas piemēru ar diviem konfigurētiem NTP serveriem un tātad minsane vērtību 2, iegūtu šādus globālos iestatījumus:

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Comment this out if you have a refclock and want it to be able to discipline
# the clock by itself (e.g. if the system is not connected to the network).
tos minclock 4 minsane 2

# Specify one or more NTP servers.
server ntp1.systancia.local
server 172.16.20.20

# Public NTP servers supporting Network Time Security:
# server time.cloudflare.com nts

# 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

Pēc jaunās konfigurācijas saglabāšanas ir jārestartē pakalpojums ntpsec:

1
systemctl restart ntpsec