将Linux系统时钟同步到Windows NTP服务 [英] Synchronize Linux System clock to Windows NTP Service

查看:867
本文介绍了将Linux系统时钟同步到Windows NTP服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个充当时钟客户端的linux PC,并且我想使用ntpdate对同一网络中相同空间中的Windows PC同步此PC的时间.我在寻找方法时遇到了麻烦.

I have a linux PC acting as a clock client and I would like to synchronize this PC's time using ntpdate against a Windows PC in the same space on the same network. I'm having trouble finding how to do this.

虽然我以为Windows Time服务是NTP服务器,但看起来并不像调用ntpdate并使用Windows PC的IP地址那样简单.您可以在下面查看该工作的结果:

It isn't as easy as just calling ntpdate and using the IP address of the windows PC it would seem although I thought that the Windows Time service was an NTP server. You can see the results of that effort below:

signageclient@signagePC:~$ sudo ntpdate -u 192.168.1.100
 1 Apr 09:49:03 ntpdate[12698]: no server suitable for synchronization found

有人可以建议我如何进行此同步吗?也许尚未启动正确的Windows服务?在上面的示例中,此命令在客户端PC(linux)上运行,而192.168.1.100是Windows PC的IP.当前没有防火墙.

Can anyone suggest how I would do this synchronization? Perhaps the proper windows service hasn't been started? In the above axample, this command is being run on the client PC (linux) and 192.168.1.100 is the IP if the windows PC. No firewall is on currently.

推荐答案

找到了答案!我需要在计算机配置"->管理模板"->系统"->"Windows时间服务"->时间提供者"下的本地组策略编辑器"中启用Windows NTP服务器.启用此功能后,我便可以与PC时钟同步:

Found the answer! I needed to enable Windows NTP Server in the Local Group Policy Editor under Computer Configuration -> Administrative Templates -> System -> Windows Time Service -> Time Providers. After I enabled this I was able to synchronize against the PCs clock:

signageclient @ signagePC:〜$ sudo ntpdate -u 192.168.1.100 4月1日 09:57:08 ntpdate [13347]:调整时间服务器192.168.1.100的偏移量 -0.031445秒

signageclient@signagePC:~$ sudo ntpdate -u 192.168.1.100 1 Apr 09:57:08 ntpdate[13347]: adjust time server 192.168.1.100 offset -0.031445 sec

(顺便说一下,这一切在Windows 7中都是如此)

(This is all in Windows 7 by the way)

这篇关于将Linux系统时钟同步到Windows NTP服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆