To install OpenNTPD on CentOS or Redhat Linux, follow these steps:
yum install openntpd
systemctl start openntpd systemctl enable openntpd
systemctl status openntpd
You should see output similar to this:
● openntpd.service - OpenNTPD System Clock Synchronization
Loaded: loaded (/usr/lib/systemd/system/openntpd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-01-01 00:00:00 UTC; 1h 1min ago
Main PID: 12345 (ntpd)
CGroup: /system.slice/openntpd.service
└─12345 /usr/sbin/ntpd -s
timedatectl utility:timedatectl set-timezone America/New_York
Replace America/New_York with the timezone that is appropriate for your location. You can see a list of available timezones by running timedatectl list-timezones.
ntpq utility to check the status of the OpenNTPD service:ntpq -p
You should see output similar to this:
remote refid st t when poll reach delay offset jitter ============================================================================== *timeserver.example.com .LOCL. 1 u 51 64 377 0.672 -4.698 1.620
The * indicates the current time source that OpenNTPD is using. The reach field indicates the status of the connection to the time server, with a value of 377 indicating a successful connection.
That's it! OpenNTPD should now be installed and configured on your system, and your local clock should be synchronized with a time server.