CentOS7搭建ntp时钟服务器

简介: CentOS7搭建ntp时钟服务器

服务器配置

# 关闭防火墙,selinux=disabled
1.# 服务器部署
[root@localhost ~]# yum -y install ntp ntpdate
2.# 查找时间同步服务器
https://www.pool.ntp.org/zone/cn
3.# 修改配置文件
[root@localhost ~]# mv /etc/ntp.conf{,.bak}    # 操作之前先备份
[root@localhost ~]# vim /etc/ntp.conf
server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
server  127.127.1.0  iburst     local  clock     # 当外部时间不可用时,使用本地时间
restrict 192.168.57.2 mask 255.255.255.0 nomodify   # 允许更新的ip地址段
4.# 启动ntp服务
[root@localhost ~]# systemctl enable ntpd --now   # 设为开机启动,并立刻启动服务
5.# 本机测试
[root@localhost ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ntp.xtom.com.hk 223.255.185.3    3 u   22   64  377  400.607  881.589  52.922
 fayetteville.nc 132.163.96.2     2 u   94   64  102  434.297  818.850 118.333
*ntpblr.roothost 153.153.36.115   2 u   94   64  376  229.075  948.388  21.710
 ntp.nic.kz      .SHM.            1 u   22   64  237  410.958  781.042  20.402
 LOCAL(0)        .LOCL.           5 l  292   64  360    0.000    0.000   0.000

远程客户端配置

[root@localhost ~]# yum -y install ntpdate     # 远程客户端需要安装ntp客户端
[root@localhost ~]# ntpdate 192.168.57.130
30 Jun 21:48:45 ntpdate[24231]: adjust time server 192.168.57.130 offset 0.002109 sec


目录
相关文章
|
9天前
|
Linux 数据库
ntp如何配置同步服务器
【5月更文挑战第24天】ntp如何配置同步服务器
19 0
|
15天前
|
Linux 数据库
ntp如何配置同步服务器
【5月更文挑战第19天】ntp如何配置同步服务器
43 2
|
22天前
|
网络协议 物联网 Linux
你不能不知道的:无公网IP,SSH远程连接CentOS服务器【内网穿透】
你不能不知道的:无公网IP,SSH远程连接CentOS服务器【内网穿透】
|
22天前
|
存储 安全 网络协议
云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南
云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南
45 0
|
22天前
|
Linux 网络安全 数据库
linux centos系统搭建samba文件服务器 NetBIOS解析 (超详细)
linux centos系统搭建samba文件服务器 NetBIOS解析 (超详细)
|
22天前
|
安全 Linux 网络安全
记录_centos搭建ftp服务器
记录_centos搭建ftp服务器
22 0
|
22天前
|
运维 Apache 数据安全/隐私保护
CentOS6.5搭建SVN服务器(Apache+SVN)
CentOS6.5搭建SVN服务器(Apache+SVN)
|
1天前
|
弹性计算 Ubuntu Linux
为什么要学习去使用云服务器,外网 IP能干什么,MAC使用Termius连接阿里云服务器。保姆级教学
为什么要学习去使用云服务器,外网 IP能干什么,MAC使用Termius连接阿里云服务器。保姆级教学
|
1天前
|
弹性计算 运维 安全
阿里云ecs使用体验
整了台服务器部署项目上线
|
2天前
|
弹性计算 安全 网络安全
带你读《从基础到应用云上安全航行指南》——干货长文快收藏!阿里云专家教你如何安全访问和管理ECS资源(3)
**《从基础到应用云上安全航行指南》——阿里云专家教你如何安全访问和管理ECS资源(3)** 在阿里云的广阔云海中,ECS(弹性计算服务)资源如同航行的船只,承载着我们的业务与数据。如何确保这些

热门文章

最新文章