步骤如下:

1. 确认没有运行ntp daemon。
# /etc/init.d/ntpd stop

2. 在/etc/ntp.conf中写入如下内容:
driftfile /etc/ntp/drift
logfile /var/log/ntp.log
server pool.ntp.org

注意:如果没有drift或logfile,需要手动创建之,并把权限设为root可读写,其他用户只读。

3. 用ntpdate手动更新时间。
这是因为当你的系统时间误差很大,有20~30分钟以上时,ntp的更新将非常慢,而ntpdate的更新一般是很快的。
# ntpdate pool.ntp.org

4. 启动ntp daemon。
# /etc/init.d/ntpd start

5. 检查ntpd的状态。
# ntpq -p如果见到ntp服务器的名字,那就说明启动成功了。

6. 添加ntpd为系统启动服务。
# chkconfig --add ntpd
# chkconfig --level 3 ntpd on
# chkconfig --level 012456 ntpd off


原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
Tags:
发表评论
表情
emotemotemotemotemotemotemotemotemotemotemotemotemot
emotemotemotemotemotemotemotemotemotemotemotemot
打开HTML 打开UBB 打开表情 隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写
 

阅读推荐

服务器相关推荐

开发相关推荐

应用软件推荐