NTP 服务器在Ubuntu上的搭建方法
- 安装NTP软件
在终端输入以下命令:
sudo apt update
sudo apt install ntp
- 配置NTP服务器
找到ntp.conf文件并进行修改:
sudo nano /etc/ntp.conf
在文件中找到server行,将其注释掉,添加以下内容:
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
保存并退出文件。
- 重启NTP服务
在终端输入以下命令:
sudo systemctl restart ntp
- 验证NTP服务器
使用ntpq命令验证NTP服务器是否正常运行:
ntpq -p
如果出现以下结果,则表明NTP服务器已经正常运行:
remote refid st t when poll reach delay offset jitter
==============================================================================
*ntp.ubuntu.com 91.189.89.199 2 u 62 128 377 0.019 0.260 0.011
至此,NTP服务器已经成功搭建完成
原文地址: http://www.cveoy.top/t/topic/fak9 著作权归作者所有。请勿转载和采集!