Ubuntu21.04にNTPサーバーNTPdをインストールする
OSバージョンの確認
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.04
DISTRIB_CODENAME=hirsute
DISTRIB_DESCRIPTION="Ubuntu 21.04″
1.NTPd のインストール
root@ubuntu:~# apt -y install ntp
略
sntp (1:4.2.8p12+dfsg-3ubuntu4.1) を設定しています …
man-db (2.9.4-2) のトリガを処理しています …
dbus (1.12.20-1ubuntu3) のトリガを処理しています …
libc-bin (2.33-0ubuntu5) のトリガを処理しています …
2.NTPd の設定
root@ubuntu:~# vim /etc/ntp.conf
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
27行目
修正前
pool ntp.ubuntu.com
修正後
#pool ntp.ubuntu.com
pool ntp.nict.jp iburst
3.ntpを再起動
root@ubuntu:~# systemctl restart ntp
4.動作確認
root@ubuntu:~# 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 *ntp-a2.nict.go. .NICT. 1 u 11 64 1 7.596 0.880 1.841 ntp-b2.nict.go. .NICT. 1 u 7 64 1 11.410 -0.906 2.651 +ntp-k1.nict.jp .nict. 1 u 9 64 1 17.474 1.049 1.921 +ntp-a3.nict.go. .NICT. 1 u 8 64 1 11.842 0.482 1.830 ntp-b3.nict.go. .NICT. 1 u 6 64 1 10.937 -0.432 2.318