BEIKE blog




sudo vim /etc/systemd/timesyncd.conf


#  This file is part of systemd.
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
# See timesyncd.conf(5) for details.



sudo systemctl daemon-reload
sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncd.service


ubuntu@ubuntu:~(17:54:19)$ sudo systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2022-02-19 17:53:05 JST; 1min 16s ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 1935 (systemd-timesyn)
   Status: "Connecting to time server ("
    Tasks: 2 (limit: 4442)
   CGroup: /system.slice/systemd-timesyncd.service
           └─1935 /lib/systemd/systemd-timesyncd

 2月 19 17:53:05 ubuntu systemd[1]: Starting Network Time Synchronization...
 2月 19 17:53:05 ubuntu systemd[1]: Started Network Time Synchronization.
 3月 06 14:03:56 ubuntu systemd-timesyncd[18103]: Synchronized to time server (