ntp服务器配置

发布时间:2026/5/27 4:10:19

ntp服务器配置 一、ubuntu 20配置1、安装 NTP 服务器安装包apt-get install -y ntp2、编辑配置文件修改配置文件/etc/ntp.conf修改以下内容restict 192.168.8.1 mask 255.255.255.0 modify notrap server 127.127.1.0 fudge 127.127.1.0 stratum 103、启动NTP服务并设置为开机自启sudo systemctl start ntp sudo systemctl enable ntp4、检查NTP服务状态和时间同步sudo systemctl status ntp ntpq -p5、离线安装ntp首先将离线安装包deb传输到离线机器然后将离线包解压到目标文件夹tar -xzvf /path/to/destination/ntp-offline.tar.gz -C /path/to/destination在离线机器上进入解压目录并使用dpkg安装所有.deb包cd /path/to/destination/ntp sudo dpkg -i *.deb如果安装过程中提示缺少依赖可以尝试以下命令修复依赖sudo apt-get install -f二、ubuntu24配置1、清理冲突使用aptitude安装sudo apt install aptitude sudo aptitude install ntp2、配置创建/etc/ntp.confserver 0.ubuntu.pool.ntp.org server 1.ubuntu.pool.ntp.org server 2.ubuntu.pool.ntp.org server 3.ubuntu.pool.ntp.org server ntp.aliyun.com iburst server ntp1.aliyun.com iburst server ntp2.aliyun.com iburst server ntp.tuna.tsinghua.edu.cn iburst server 127.127.1.0 fudge 127.127.1.0 stratum 10

相关新闻