見出し画像

GCP Debian12 systemd-timesyncd設定変更 時刻同期サーバー変更


前提条件

VMインスタンス(サーバー)の作成が必要です。
下記の内容をご参考にしてください。

タイムゾーンも東京時刻に変更してください。
下記の内容をご参考にしてください。

ご説明

Debinan12でデフォルト設定の「systemd-timesyncd」を設定変更いたします。デフォルト参照先は「169.254.169.254」になっておりますが、
今回は、「ntp.nict.jp」に変更したいと思います。

systemd-timesyncd設定変更

対象サーバーにログインいたします。
下記のコマンドを実施いたします。

sudo -i

vi /etc/systemd/timesyncd.conf
NTP=ntp.nict.jp

systemctl restart systemd-timesyncd

timedatectl show-timesync --all

sudo -i
rootユーザーに切り替わります。

vi /etc/systemd/timesyncd.conf
NTP=ntp.nict.jp
viで変更先のサーバーに編集いたします。

systemctl restart systemd-timesyncd
systemd-timesyncdを再起動いたします。

時刻同期サーバー変更確認

下記のコマンドを実施いたします。

timedatectl show-timesync --all

timedatectl show-timesync --all
SystemNTPServersがntp.nict.jpに変更されたか確認いたします。

以上で「GCP Debian12 systemd-timesyncd設定変更 時刻同期サーバー変更」を完了いたします。





いいなと思ったら応援しよう!