ntp 配置

来源:互联网 发布:哲学家就餐问题c语言 编辑:程序博客网 时间:2024/06/10 04:21

安装软件:

CentOS:

    yum install ntp

SUSE:

    zypper in ntpd


vim /etc/ntp.conf

    #从互联网同步,此为互联网ntp server

    server cn.pool.ntp.org iburst

    #从本地同步,此为本地ntp server

    server 10.240.217.71 iburst

    

    #使本机能作为ntp server提供ntp service

    restrict default nomodify notrap nopeer noquery


手动执行第一次ntp

    ntpdate cn.pool.ntp.org


使能ntp daemon

    systemctl restart ntpd


使能开机运行dameon

    systemctl enable ntpd


查看运行状况

    ntpq -p


1 0