国内服务器
亚洲服务器
欧洲服务器
北美洲服务器
南美洲服务器
大洋洲服务器
非洲服务器

首页>>服务器

NTP服务器怎么配置和部署

发表时间:2022-12-14 07:54:53

NTP服务器怎样配置和部署

NTP服务器配置和部署的方法:1、使用cp命令备份ntp服务器配置文件;2、使用egrep命令优化配置文件;3、使用vim命令编辑配置文件,包括配置文件文本、允许内网其他机器同步时间、定义使用的上游ntp服务器和定义服务器时间;4、启动NTP服务器;5、测试服务器与客户端时间是否是同步。

具体操作以下:

1、备份ntp服务器配置文件

cp /etc/ntp.conf /etc/ntp.conf.bak

ll /etc/ntp.conf*

2、精简优化配置文件

egrep -v "^$|#" /etc/ntp.conf.bak >/etc/ntp.conf

3、编辑配置文件

vim /etc/ntp.conf

配置文件文本

driftfile /var/lib/ntp/drift

restrict default kod nomodify notrap nopeer noquery

restrict ⑹ default kod nomodify notrap nopeer noquery

restrict 127.0.0.1 

restrict ⑹ ::1

允许内网其他机器同步时间

restrict 172.16.1.0 mask 255.255.255.0 nomodify notr

#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

定义使用的上游 ntp服务器,将原来的注释

server ntp1.aliyun.com

server time1.aliyun.com

允许上层时间服务器主动修改本机时间

restrict time1.aliyun.com nomodify notrap noquery

restrict ntp1.aliyun.com nomodify notrap noquery

外部时间服务器不可用时,以本地时间作为时间服务

server 127.127.1.0 

fudge 127.127.1.0 stratum 10

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

4、启动NTP服务器

Centos6: /etc/init.d/ntpd start centos7: systemctl start ntpd

ntpq -p 显示节点列表

5、客户端时间同步测试

ntpdate 10.0.0.111(ntp服务器)

上一篇 下一篇
最新文章

如何提高云服务器的安全系数

香港独立IP空间有什么优势

香港空间影响百度收录吗

为啥要租用美国VPS

VPS的缺点有哪些

香港vps作用在哪里

VPS的优点有哪些

外贸网站为啥选择美国vps

VPS能建多少个网站

VPS要如何选择位置

相关文章

美国不用备案空间租用怎么提高安全性

waf和防火墙的差别

南美洲系列之—墨西哥云主机租用攻略

香港服务器托管设置及其重要性

影响服务器租用价格的因素有哪些?_服务器租用价格

JetServer : 39$/月/2C512M内存100G硬盘/50M/不限流量/以色列等/信用卡支持

有哪些行业需要租用高防服务器

探访美国服务器租赁的经济之地- 不可错过的低价选择

sdwan业务经济效益

租用美国服务器连接不上的情况有哪些

X

截屏,微信识别二维码

微信号:muhuanidc

(点击微信号复制,添加好友)

打开微信

微信号已复制,请打开微信添加咨询详情!