Site Tools


marc:linux:ntp

This is an old revision of the document!


NTP:

Config file:

/etc/ntp.conf

timedatectl:

Gives information on time, date and timezone:

timedatectl
Local time: Sun 2021-11-21 11:57:23 CET
           Universal time: Sun 2021-11-21 10:57:23 UTC
                 RTC time: Sun 2021-11-21 10:57:23
                Time zone: Europe/Amsterdam (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Voorbeeld van ntp.conf:

## Use 'server' for a real NTP server and use 'pool' for
## a pool of servers if the ntp version supports it,
## otherwise define multiple server lines (See: www.pool.ntp.org/en/use.html)
## Added 'iburst' to speed up the initial synchronization.
server          172.17.9.58 iburst
## Multiple server configuration is possible:
server          ntp-time.for.mydomain
server          otherntp.server.org
server          ntp.research.gov 	

driftfile       /var/lib/ntp/drift/ntp.drift
logfile         /var/log/ntp

## Key file containing the keys and key identifiers used when operating
## with symmetric key cryptography - disabled
#keys           /etc/ntp.keys

## Specify the key identifiers which are trusted.
trustedkey      1

## Specify the key identifier to use with the ntpdc utility.
requestkey      1

## mitigate CVE-2013-5211 in case we are running a version before 4.2.7p26
## N/A for SLES12SP3 GA
#disable                monitor

## Permit time synchronization with our time source, but do not
## permit the source to query or modify the service on this system.
restrict        default         kod limited nomodify notrap nopeer noquery
restrict -6     default         kod limited nomodify notrap nopeer noquery

## Permit all access over the loopback interface. This could
## be tightened as well, but to do so would effect some of
## the administrative functions.
restrict        127.0.0.1
restrict -6     ::1

Om handmatig een sync te doen:

ntpdate -u 10.126.33.101

output: 29 Jun 09:45:03 ntpdate[1649]: step time server 10.126.33.101 offset 126.149871 sec

Apply changes:

service ntpd start 

or

systemctl start ntpd
marc/linux/ntp.1637492273.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki