In this post we’ll look at NTP configuration by using chrony, which is installed by default on newer RedHat systems.
Ensure that the chronyd service is started and let’s take a look at the current time setttings:
Local time: Thu 2018-02-15 02:15:51 JST
Universal time: Wed 2018-02-14 17:15:51 UTC
RTC time: Wed 2018-02-14 17:15:52
Time zone: Asia/Tokyo (JST, +0900)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
Now look inside chrony’s config file, which is /etc/chrony.conf:
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst
# Ignore stratum in source selection.
# Record the rate at which the system clock gains/losses time.
# Enable kernel RTC synchronization.
# In first three updates step the system clock instead of slew
# if the adjustment is larger than 10 seconds.
makestep 10 3
# Allow NTP client access from local network.
# Listen for commands only on localhost.
# Serve time even if not synchronized to any NTP server.
#local stratum 10
# Specify the key used as password for chronyc.
# Generate command key if missing.
# Disable logging of client accesses.
# Send a message to syslog if a clock adjustment is larger than 0.5 seconds.
#log measurements statistics tracking
There is a set of default servers configured, but you can add your own. You can also allow NTP client access in the local network by uncommenting or adding the allow directive with a range.
In the previous timedatectl output we saw that NTP and synchronization weren’t enabled, so let’s enable them:
/ Give thought to your reputation. \
| Consider changing name and moving to a |
\ new town. /