时间同步ntp服务的安装与配置(作为客户端的配置)

yum安装ntpd服务

 

1.yum -y install ntp ntpdate        #安装时间同步ntp服务

                       

2.修改ntpd服务的配置文件,位置   vi /etc/ntp.conf     

 

 3.

#server 0.centos.pool.ntp.org iburst

#server 1.centos.pool.ntp.org iburst

#server 2.centos.pool.ntp.org iburst

#server 3.centos.pool.ntp.org iburst

 

server 192.168.100.140 iburst         #指定与140同步

修改配置文件,指定和谁同步时间(140),上面的0-3前面都加#

 

 4. systemctl restart ntpd.service       #重启ntpd服务

原文地址:https://www.cnblogs.com/lql123/p/5947176.html