Ubuntu 离线安装ntp 并部署 ntp 服务器及同步客户端时间

1. 离线安装ntp

在互联网机上使用root用户运行命令: apt-get install ntp

运行完后,相应的安装包会download到 /var/cache/apt/archives/下;我已经离线好的包(里边有相关依赖包,所以会比较大,大概200M)在这里:百度云盘离线安装包

下图是该目录下文件的截图

《Ubuntu 离线安装ntp 并部署 ntp 服务器及同步客户端时间》 图1 /var/cache/apt/archives/

离线安装的命令也是:使用root用户执行 apt-get install ntp

《Ubuntu 离线安装ntp 并部署 ntp 服务器及同步客户端时间》 图2 apt-get install ntp

安装完,查看 /etc/passwd,可以看到添加了一个新用户ntp

《Ubuntu 离线安装ntp 并部署 ntp 服务器及同步客户端时间》 图3  /etc/passwd查看ntp用户

2.配置ntp服务器

配置ntp服务器的文件位置在/etc/ntp.conf

《Ubuntu 离线安装ntp 并部署 ntp 服务器及同步客户端时间》
图4 ntp.conf配置

配置完后,重启ntp, 命令为:

service ntp restart  或者 /etc/init.d/ntp restart

《Ubuntu 离线安装ntp 并部署 ntp 服务器及同步客户端时间》 图 5 ntp 服务重启

3. 客户端 ntpdate向ntp 服务器发送同步时间请求

ntpdate 220.130.158.71

    原文作者:雨笋情缘
    原文地址: https://www.jianshu.com/p/5ca8c6e39df1
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞