以下是在Ubuntu上搭建NTP服务器的步骤:
-
安装ntp服务。在终端中输入以下命令:
sudo apt-get update sudo apt-get install ntp
-
打开NTP配置文件。在终端中输入以下命令:
sudo vi /etc/ntp.conf
-
修改配置文件。找到“pool”行并注释掉,然后添加以下内容:
server ntp.aliyun.com server ntp.tencent.com server ntp.ntsc.ac.cn
-
保存配置文件并重启ntp服务。在终端中输入以下命令:
sudo systemctl ntp restart
现在,您的Ubuntu系统已成为NTP服务器,并将使用官方的时间服务器同步时间。您可以在其他计算机上将该服务器配置为NTP服务器,以同步时间。