如何在 CentOS 中设置 NTP 服务器

 我来答
匿名用户
2016-12-18
展开全部
1. Linux
NTP 客户端主机需要 ntpupdate 软件包来和服务器同步时间。可以轻松地使用 yum 或 apt-get 安装这个软件包。安装完软件包之后,用服务器的 IP 地址运行下面的命令。
# ntpdate <server-IP-address>
基于 RHEL 和 Debian 的系统命令都相同。
2. Windows
如果你正在使用 Windows,在日期和时间设置(Date and Time settings)下查找网络时间(Internet Time)。
3. Cisco 设备
如果你想要同步 Cisco 设备的时间,你可以在全局配置模式下使用下面的命令。
# ntp server <server-IP-address>
来自其它厂家的支持 NTP 的设备有自己的用于网络时间的参数。如果你想将设备和 NTP服务器同步时间,请查看设备的说明文档。
快又稳
2024-10-23 广告
广州快又稳网络科技有限公司是一家集技术研发、产品创新、服务优化于一体的高新技术企业。公司自成立以来,始终秉承“网络使人类缩进距离,我们让网络快又稳”的核心理念,致力于为全球客户提供高效、安全、易用的互联网解决方案及信息技术服务。在数字时代,... 点击进入详情页
本回答由快又稳提供
遗央4623
2016-12-18 · TA获得超过128个赞
知道小有建树答主
回答量:520
采纳率:0%
帮助的人:214万
展开全部
一、搭建时间服务器
1、在一台linux服务器安装ntp server
tar zxvf ntp-4.2.6.tar.gz
cd ntp-4.2.6
./configure --prefix=/usr/local/ntp --enable-all-clocks --enable-parse-clocks
make && make install
2、修改ntp.conf配置文件
vi /etc/ntp.conf
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
#restrict default kod nomodify notrap nopeer noquery
restrict default nomodify
(允许任何IP的客户机都可以进行时间同步,如果是只允许某个网段的客户机进行时间同步可以这样写
restrict 10.58.26.0 mask 255.255.255.0 nomodify)
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool
#server 0.rhel.pool.ntp.org(默认时间服务器)
#server 1.rhel.pool.ntp.org(默认时间服务器)
#server 2.rhel.pool.ntp.org(默认时间服务器)
server 10.128.14.25 (手工设置的时间服务器)
(如果是可以直连外网,可以使用LINUX默认提供的三组标准时间服务器,否则可以自己指定一个同步时间源)
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式