Windows中NTP服务器的搭建和时间同步

转载来源 :Windows中NTP服务器的搭建和时间同步 :http://www.lwops.cn/thread-308-1-1.html

一、NTP服务器

1.安装NTP服务

# yum install  -y ntp

2.修改ntp的配置文件

[root@localhost ~]#  grep -Ev "^#|^$" /etc/ntp.conf
driftfile /var/lib/ntp/drift
pidfile   /var/run/ntpd.pid
logfile /var/log/ntp.log
restrict -4 default kod notrap nomodify
restrict -6 default kod notrap nomodify
restrict 127.0.0.1
restrict ::1
server ntp.aliyun.com iburst minpoll 4 maxpoll 10
restrict ntp.aliyun.com nomodify notrap nopeer noquery
server 127.127.1.0
fudge 127.127.1.0 stratum 8
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor

3.重启服务

# systemctl start ntpd.service
# systemctl enable ntpd.service

4.查看状态

[root@localhost ~]# ntpstat
synchronised to NTP server (203.107.6.88) at stratum 3
   time correct to within 46 ms
   polling server every 1024 s
[root@localhost ~]#

二、Linux客户端配置

1.安装ntp客户端,先手动同步

# /usr/sbin/ntpdate -u  10.2.2.188
# yum install -y ntpdate  

2.写入定时计划

# echo "0 5 * * *  /usr/sbin/ntpdate -u  10.2.2.188" >> /var/spool/cron/root
# echo "5 5 * * *  /usr/sbin/hwclock -w" >> /var/spool/cron/root

三、window2012客户端配置(若有域环境直接修改与控制器即可)

1.打开powershell终端管理,输入gpedit.msc,打开策略管理器
在这里插入图片描述
2.计算机配置–>管理模板–>系统–>Windows时间服务–>时间提供程序,配置(windows客户端和启动客户端)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
3.跟新策略

参考链接 :Windows中NTP服务器的搭建和时间同步 :http://www.lwops.cn/thread-308-1-1.html

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值