您在这里:

目录

NTP服务器搭建

1.NTP服务简介

NTP(Network Time Protocol,网络时间协议)是用来使网络中的各个计算机时间同步的一种协议,它的作用是用来同步客户端时间。

2.NTP服务搭建

2.1.环境准备

主机名称IP地址系统版本角色
NTP192.168.10.190CentOS 7NTP Server
Client1192.168.10.191CentOS 7Client

2.2.NTP服务安装

查看系统是否安装ntp服务
rpm -qa ntp
若没有安装,输入下方命令安装
yum -y install nto

2.3.NTP服务配置

ntp服务默认配置文件是/etc/ntp.conf
输入vim /etc/ntp.conf
注释此行内容
#restrict default kod nomodify notrap nopeer noquery
添加以下内容
restrict default nomodify
以下是NTP服务默认的时间同步源,将其注释
#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 time1.aliyun.com

2.4.NTP服务启动

输入下方命令
systemctl enable ntpd.service
systemctl start ntpd.service

查看ntp服务器状态
ntpq -p

3.客户端同步时间

ntpdate 192.168.10.190同步NTP Server

发表回复

你的电子邮件地址不会被公开 * 为必填字段

提交评论

FLOWEVER

相关文章

网络“特工007”

高档小区生面孔想混进去?保安连环盘问+权限管控,可疑行为立马被“请出去”!深信服零信任就像007特工保安,每次进门严查身份,异常行为秒拦截!