美文网首页Linux 运维
Ubuntu 离线安装ntp 并部署 ntp 服务器及同步客户端

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

作者: 雨笋情缘 | 来源:发表于2018-10-31 16:57 被阅读5次

1. 离线安装ntp

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

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

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

图1 /var/cache/apt/archives/

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

图2 apt-get install ntp

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

图3  /etc/passwd查看ntp用户

2.配置ntp服务器

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

图4 ntp.conf配置

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

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

图 5 ntp 服务重启

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

ntpdate 220.130.158.71


相关文章

网友评论

    本文标题:Ubuntu 离线安装ntp 并部署 ntp 服务器及同步客户端

    本文链接:https://www.haomeiwen.com/subject/osbatqtx.html