在 Ubuntu server 22.04 設定 NTP server 校時
在 Ubuntu server 22.04 設定 NTP server 校時 工程絲 · Follow Feb 16, 2023 使用 systemd-timesyncd,在 ubuntu server22.04 上指定特定的 NTP server 來自動校時 1. 安裝 systemd-timesyncd apt install systemd-timesyncd timedatectl set-ntp true sudo systemctl start systemd-timesyncd 2. 檢查安裝 systemctl status systemd-timesyncd 結果範例 ● systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2023-02-16 11:06:08 CST; 16min ago Docs: man:systemd-timesyncd.service(8) Main PID: 12832 (systemd-timesyn) Status: "Idle." Tasks: 2 ( limit : 19067) Memory: 1.2M CPU: 52ms CGroup: /system.slice/systemd-timesyncd.service └─12832 /lib/systemd/systemd-timesyncd 3. 設定:編輯 /etc/systemd/timesyncd.conf sudo vi /etc/systemd/timesyncd.conf 內容 [Time] NTP =ntp.server.you.want #FallbackNTP=ntp.ubuntu.com #RootDistanceMaxSec=5 #PollIntervalMinSec=3