・Chrony のインストール
時刻(NTP)サーバーは標準でインストールされるが念のため確認します
[root@alma]# dnf list installed | grep chrony
chrony.x86_64※インストールされている
もしインストールされていなければインストールします
[root@alma]# dnf -y install chrony
・ntp の設定
[root@alma]# vi /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (https://www.pool.ntp.org/join.html).
pool 2.almalinux.pool.ntp.org iburst
↓※書き換え
pool ntp.nict.jp iburst※独立行政法人 情報通信研究機構のNTPサーバーに変更(日本標準時)
# Use NTP servers from DHCP.
sourcedir /run/chrony-dhcp
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync
# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *
# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2
# Allow NTP client access from local network.
#allow 192.168.0.0/16
↓※コメントを解除して書き換え LAN 内からの時刻同期を許可
allow 192.168.1.0/24
≪ 以下省略 ≫
・ntp の起動
[root@alma]# systemctl start chronyd
・ntpd の自動起動設定
[root@alma]# systemctl enable chronyd
・自動起動設定の確認
[root@alma]# systemctl is-enabled chronyd
enabled※enabled になっていればOK