- /etc/ntp.conf の設定
# yum install ntp
# vi /etc/ntp.conf
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap ← 追加(内部からの時刻同期を許可)
# 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
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
↓ 時刻同期先NTPサーバーを変更
server ntp.nict.jp # 日本標準時を提供しているNTPサーバー(stratum 1)
server ntp.jst.mfeed.ad.jp # 上記サーバーと直接同期しているNTPサーバー(stratum 2)
- NTPd起動
# ntpdate ntp.nict.jp
# /etc/rc.d/init.d/ntpd start
# chkconfig ntpd on
# chkconfig --list ntpd
- 同期確認
# ntpq -p
結果行の先頭に '*', '+' が付いていればok