Synchronize Linux System clock to Windows NTP Serv

2019-03-04 12:08发布

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.

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

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.

1条回答
狗以群分
2楼-- · 2019-03-04 12:45

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 1 Apr 09:57:08 ntpdate[13347]: adjust time server 192.168.1.100 offset -0.031445 sec

(This is all in Windows 7 by the way)

查看更多
登录 后发表回答