Ubuntu 时间不准,怎么设置NTP时间同步?

设置时区、ntp服务器

sudo timedatectl set-timezone Asia/Shanghai
sudo sed -i 's/#RootDistanceMaxSec=5/RootDistanceMaxSec=999999999/' /etc/systemd/timesyncd.conf
sudo sed -i 's/#NTP=/NTP=ntp.aliyun.com/' /etc/systemd/timesyncd.conf
systemctl restart systemd-timesyncd
posted @ 2024-03-21 01:46  Yfeil  阅读(327)  评论(0编辑  收藏  举报