- Linux Administration Cookbook
- Adam K. Dean
- 135字
- 2025-04-04 15:16:16
Enabling an NTP client
Assuming that your system isn't using chronyd, and its date is sliding constantly, you can enable it manually.
The configuration file for chronyd is located at /etc/chrony.conf. The following is the default configuration file, with the commented out sections removed:
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony
Once in place, if it's not already in place and running, systemd is used to maintain the service:
$ sudo systemctl enable chronyd
$ sudo systemctl start chronyd
Do check that a rogue admin hasn't taken it upon themselves to install openntpd, or a different daemon, to try and manage NTP. You can check this by using the preceding tcpdump commands, or seeing if anything is running on port 123.