在我的 lubuntu 22.04 中激活了该服务systemd-timesyncd
。这是该服务的状态:
> systemctl status systemd-timesyncd
# this is the output of the previous command:
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-07-06 12:21:43 CEST; 2min 54s ago
Docs: man:systemd-timesyncd.service(8)
Main PID: 1917 (systemd-timesyn)
Status: "Idle."
Tasks: 2 (limit: 2030)
Memory: 1.3M
CPU: 201ms
CGroup: /system.slice/systemd-timesyncd.service
└─1917 /lib/systemd/systemd-timesyncd
lug 06 12:21:55 ceia-te systemd-timesyncd[1917]: Timed out waiting for reply from 185.125.190.57:123 (ntp.ubuntu.com).
lug 06 12:22:05 ceia-te systemd-timesyncd[1917]: Timed out waiting for reply from 185.125.190.58:123 (ntp.ubuntu.com).
lug 06 12:22:15 ceia-te systemd-timesyncd[1917]: Timed out waiting for reply from 185.125.190.56:123 (ntp.ubuntu.com).
lug 06 12:22:25 ceia-te systemd-timesyncd[1917]: Timed out waiting for reply from 91.189.94.4:123 (ntp.ubuntu.com).
输出显示该服务正在运行并尝试连接到 NTP 服务器ntp.ubuntu.com
,但没有收到任何回复(请参阅 messages Timed out waiting for reply from ntp.ubuntu.com
);通过 ping 可以访问该服务器,我们可以通过以下命令的输出看到:
> ping ntp.ubuntu.com
PING ntp.ubuntu.com (91.189.94.4) 56(84) bytes of data.
64 bytes from pugot.canonical.com (91.189.94.4): icmp_seq=1 ttl=53 time=30.0 ms
64 bytes from pugot.canonical.com (91.189.94.4): icmp_seq=2 ttl=53 time=29.8 ms
64 bytes from pugot.canonical.com (91.189.94.4): icmp_seq=3 ttl=53 time=29.8 ms
防火墙iptables
未激活:
> sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
有人可以告诉我为什么 timesyncd 客户端没有收到来自 NTP 服务器的任何回复吗ntp.ubuntu.com
?
谢谢
问题出在互联网服务提供商身上
感谢您的评论。我尝试连接到另一个网络,该网络能够通过我撰写帖子时使用的网络的其他方式连接到互联网。
通过另一个网络并且无需对配置文件进行任何修改,
/etc/systemd/timesyncd.conf
即:NTP客户端
systemd timesyncd
可以将系统日期同步到NTP服务器ntp.ubuntu.com
。事实上服务的状态
systemd-timesyncd.service
如下:因此,无需对 lubuntu 配置进行任何修改,也无需安装任何其他软件包,系统即可正常工作。