免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1330 | 回复: 0
打印 上一主题 下一主题

简单配置NTP时间同步服务器 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-15 19:33 |只看该作者 |倒序浏览
简单配置NTP时间同步服务器

2009.07.12 TsengYia#126.com
http://selinux.cublog.cn

##########################################################################
系统环境:RHEL5 [ 2.6.18-8.el5xen ]
软件环境:
    ntp-4.2.2p1-5.el5
##########################################################################

一. 配置NTP时间服务器器(192.168.4.1)
shell> cp /etc/ntp.conf /etc/ntp.conf.bak
shell> vi /etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
#server 0.rhel.pool.ntp.org         #//设置网络时间服务器,作为更新源
#server 1.rhel.pool.ntp.org         #//内网中可以注释掉这些行,采用本机硬件时钟作为同步基准
#server 2.rhel.pool.ntp.org
restrict 192.168.4.0 mask 255.255.255.0 nomodify notrap        #//设置客户端网络
server 127.127.1.0                                             #//采用本机硬件时钟作为时间源
fudge 127.127.1.0 stratum 10

shell> /etc/init.d/ntpd start        #//等大约5分钟完成本机时间同步以后,方可作为时间服务器使用

二、在客户机进行时间同步
  1. Linux客户机
shell> ntpdate 192.168.4.1
shell> hwclock --systohc              //以当前系统时间设置硬件时间
shell> crontab -e
30 7 * * * /usr/sbin/ntpdate 192.168.4.1 && hwclock --systohc
shell> /etc/init.d/crond start

  2. Windows客户机
C:\> net time /setsntp:192.168.4.1    //设置时间服务器地址
C:\> w32tm /resync                    //重新同步时间
  —— 或者通过“日期和时间属性”对话框进行设置

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40349/showart_1997399.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP