Ubuntu 22.04にNTPサーバーNTPdをインストールする
環境
OSバージョンの確認
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
NTPdのインストール方法
1.ntpのインストール
# apt -y install ntp
# apt -y install ntp
# apt -y install ntp
2.配置ファイルを設定します
21行目~24行目
修正前
pool 0.ubuntu.pool.ntp.org iburst
pool 1.ubuntu.pool.ntp.org iburst
pool 2.ubuntu.pool.ntp.org iburst
pool 3.ubuntu.pool.ntp.org iburst
pool 0.ubuntu.pool.ntp.org iburst
pool 1.ubuntu.pool.ntp.org iburst
pool 2.ubuntu.pool.ntp.org iburst
pool 3.ubuntu.pool.ntp.org iburst
pool 0.ubuntu.pool.ntp.org iburst pool 1.ubuntu.pool.ntp.org iburst pool 2.ubuntu.pool.ntp.org iburst pool 3.ubuntu.pool.ntp.org iburst
修正後
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
#pool 0.ubuntu.pool.ntp.org iburst #pool 1.ubuntu.pool.ntp.org iburst #pool 2.ubuntu.pool.ntp.org iburst #pool 3.ubuntu.pool.ntp.org iburst
27行目
修正前
pool ntp.ubuntu.com
pool ntp.ubuntu.com
pool ntp.ubuntu.com
修正後
#pool ntp.ubuntu.com
pool ntp.nict.jp iburst
#pool ntp.ubuntu.com
pool ntp.nict.jp iburst
#pool ntp.ubuntu.com pool ntp.nict.jp iburst
3.ntpを再起動します
# systemctl restart ntp
# systemctl restart ntp
# systemctl restart ntp
4.動作確認
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
ntp.nict.jp .POOL. 16 p - 64 0 0.000 +0.000 0.000
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
ntp.nict.jp .POOL. 16 p - 64 0 0.000 +0.000 0.000
# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== ntp.nict.jp .POOL. 16 p - 64 0 0.000 +0.000 0.000