zoukankan      html  css  js  c++  java
  • CentOS 5设置NTP服务器

    CentOS 5设置NTP服务器 | 涂虫小记

    CentOS 5设置NTP服务器

    参考文献:Setup NTP Server

    其实非常简单,因为在CentOS 5不再区分客户端和服务器,只要配置了NTP,它就会提供NTP服务。这一点与Solaris不同,其中提供了ntp.client和ntp.server可供选择,想使用哪个直接用相应文件覆盖/etc/ntp.conf即可。

    1)确认已经ntp程序包:

    # yum install ntp

    2)配置时间源

    # vi /etc/ntp.conf

    server time.lib.tsinghua.edu.cn

    server 0.pool.ntp.org

    server 1.pool.ntp.org

    server 2.pool.ntp.org

    3)配置是否为其他PC提供时间服务

    # vi /etc/ntp.conf

    restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

    4)配置开机时自动运行时间服务

    # chkconfig ntpd on

    5)启动或停止时间服务

    # service ntpd start

    # service ntpd stop

    # service ntpd restart

    6)验证ntp服务已经运行

    # pgrep ntpd

    7)初始同步

    # ntpdate -u time.lib.tsinghua.edu.cn

    8)确认同步成功

    # ntpq -p

    当然,如果要提供时间服务,还必须相应的设置iptable防火墙的配置。CentOS的时间服务使用udp 123端口。

  • 相关阅读:
    P2572 [SCOI2010]序列操作
    python学习笔记2
    嗯,python
    ETROBOT——审题
    条件编译
    第三章单片机简介
    模拟输入输出
    arduino库函数1
    arduino相关文献阅读
    Arduino的小灯亮起来~~~
  • 原文地址:https://www.cnblogs.com/lexus/p/2574799.html
Copyright © 2011-2022 走看看