[文章作者:张宴 本文版本:v1.1 最后修改:2010.02.21 转载请注明出处:http://blog.zyan.cc]

一、搭建时间同步服务器
1、编译安装ntp server
wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2.6.tar.gz
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

注:如以上下载地址无法访问,请从ntp官方下载网页(http://www.ntp.org/downloads.html)寻找下载地址。

2、修改ntp.conf配置文件
vi /etc/ntp.conf

①、第一种配置:允许任何IP的客户机都可以进行时间同步
将“restrict default kod nomodify notrap nopeer noquery”这行修改成:
restrict default nomodify

配置文件示例:/etc/ntp.conf

②、第二种配置:只允许192.168.18.***网段的客户机进行时间同步
在restrict default nomodify notrap noquery(表示默认拒绝所有IP的时间同步)之后增加一行:
restrict 192.168.18.0 mask 255.255.255.0 nomodify

配置文件示例:/etc/ntp.conf

3、以守护进程启动ntpd
/usr/local/ntp/bin/ntpd -c /etc/ntp.conf -p /tmp/ntpd.pid

4、ntpd启动后,客户机要等几分钟再与其进行时间同步,否则会提示“no server suitable for synchronization found”错误。

二、配置时间同步客户机
vi /var/spool/cron/root

增加一行,在每天的5点13分、9点13分、14点13分、19点13分与时间同步服务器进行同步
13 5,9,14,19 * * * /usr/sbin/ntpdate 192.168.18.2

备注:如果客户机没有ntpdate,可以下载ntpdate.tar.gz到/usr/sbin/目录,然后解压:
wget http://blog.zyan.cc/attachment/200708/ntdate.tar.gz
cd /usr/sbin/
tar zxvf ntpdate.tar.gz


Tags:



技术大类 » 其他Unix技术 | 评论(60) | 引用(0) | 阅读(89254)
shz Email
2022-8-2 02:56
I truly like you're composing style, incredible data, thankyou for posting.  Dow Janes Review
shzz Email
2022-8-2 02:57
Thank you so much for ding the impressive job here, everyone will surely like your post.  Cardone Capital Review
shzz Email
2022-8-2 03:00
I'm happy to see the considerable subtle element here!.  Cardone Capital Review
shz Email
2022-8-2 03:00
I would recommend my profile is important to me, I invite you to discuss this topic...  Dow Janes Review
shzz Email
2022-8-2 03:03
All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks  Cardone Capital Review
shz Email
2022-8-2 03:04
Always so interesting to visit your site.What a great info, thank you for sharing. this will help me so much in my learning  Dow Janes Review
shzz Email
2022-8-2 03:06
A debt of gratitude is in order for giving late reports with respect to the worry, I anticipate read more.  Cardone Capital Review
shzz Email
2022-8-2 03:09
Thank you for the post. I will definitely comeback.  Cardone Capital Review
shz Email
2022-8-2 03:10
I really enjoyed reading this post, big fan. Keep up the good work andplease tell me when can you publish more articles or where can I read more on the subject?  Dow Janes Review
shz Email
2022-8-2 23:41
Excellent effort to make this blog more wonderful and attractive.  online business
shz Email
2022-8-2 23:42
Your work is very good and I appreciate you and hopping for some more informative posts  online business
shz Email
2022-8-2 23:45
The web site is lovingly serviced and saved as much as date. So it should be, thanks for sharing this with us.  online business
shz Email
2022-8-2 23:49
The worst part of it was that the software only worked intermittently and the data was not accurate. You obviously canot confront anyone about what you have discovered if the information is not right.  online business
shz Email
2022-8-2 23:51
Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.  online business
shz Email
2022-8-2 23:52
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own Blog Engine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.  online business
shz Email
2022-8-2 23:54
cool stuff you have and you keep overhaul every one of us  online business
shz Email
2022-8-2 23:57
Going to graduate school was a positive decision for me. I enjoyed the coursework, the presentations, the fellow students, and the professors. And since my company reimbursed 100% of the tuition, the only cost that I had to pay on my own was for books and supplies. Otherwise, I received a free master’s degree. All that I had to invest was my time.  online business
shz Email
2022-8-3 00:00
Gangaur Realtech is a professionally managed organisation specializing in real estate services where integrated services are provided by professionals to its clients seeking increased value by owning, occupying or investing in real estate.  online business
分页: 3/3 第一页 上页 1 2 3 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]