Linux配置自动时间同步

栏目: 服务器 · Linux · 发布时间: 8年前

内容简介:Linux配置自动时间同步

Linux配置自动时间同步

时间同步命令:

ntpdata time.windows.com

 

自动时间同步:

需要配置/etc/crontab文件,实现自动执行任务

 

linux 从time.windows.com自动同步时间

vi /etc/crontab

加上一句:

00 0 1 * * root ntpdate -s time.windows.com

time.nist.gov 是一个时间服务器.

 

Linux时间服务器配置(192.168.10.1)

1). # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm

2). # vi /etc/ntp.conf

注释一行

restrict default ignore

加入一行

restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap

3). # vi /etc/ntp/step-tickers

加入一行

pool.ntp.org

这样每次ntpd启动时,会自动连接该国际标准时间服务器;

4). # service ntpd start

5). # netstat -an |grep 123

确保该端口以udp方式开放

时间客户端配置(192.168.10.2)

1). # ntpdate 192.168.10.2

应该显示同步成功

2). # crond -e

加入

0-59/10 * * * * /usr/sbin/ntpdate 192.168.10.1

表示每隔10分钟同步一次时间


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

XMPP

XMPP

Peter Saint-Andre、Kevin Smith、Remko TronCon / O'Reilly Media / 2009-5-4 / USD 39.99

This practical book provides everything you need to know about the Extensible Messaging and Presence Protocol (XMPP). This open technology for real-time communication is used in many diverse applicati......一起来看看 《XMPP》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具