Ubuntu离线安装ntp服务
准备阶段:下载安装包
apt-get download ntp
apt-get download ntpdate

一、服务端( 192.166.6.xx)
1、环境准备
先判断是否已安装 systemd-timesyncd
systemctl is-active systemd-timesyncd
如果返回结果是 active,则表示 systemd-timesyncd 已经在运行。在这种情况下,你可以使用以下命令停止并卸载它:
sudo systemctl stop systemd-timesyncd
sudo systemctl disable systemd-timesyncd
sudo apt-get remove systemd-timesyncd
如果返回inactive,则表示 systemd-timesyncd没有在运行,可直接安装ntp
2、安装
sudo dpkg -i ntp包
sudo dpkg -i ntpdate包
2、编辑配置文件/etc/ntp.conf
# /etc/ntp.conf, NTP服务配置文件
# 指定 drift 文件的位置,它用于存储系统时钟的漂移信息
driftfile /var/lib/ntp/ntp.drift
# 指定闰秒的定义文件
leapfile /usr/share/zoneinfo/leap-seconds.list
# 启用统计数据记录,以便进行性

本文详细描述了如何在Ubuntu系统上离线安装和配置ntp服务,包括服务端和客户端的环境准备、systemd-timesyncd管理、ntp.conf文件编辑以及权限设置,还提供了手动更新时钟的方法。
1829

被折叠的 条评论
为什么被折叠?



