centos 6.5 ntp 服务器搭建

简介:

1、配置内网NTP-Server(192.168.1.135)

# yum install ntp

# chkconfig ntpd on

# chkconfig --list ntpd

#vim /etc/ntp.conf

------------------------------------------------------------------------------------------- 

# Hosts on local network are less restricted.

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

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap


# 中国这边最活跃的时间服务器 : http://www.pool.ntp.org/zone/cn

server 210.72.145.44 perfer   # 中国国家受时中心

server 202.112.10.36             # 1.cn.pool.ntp.org

server 59.124.196.83             # 0.asia.pool.ntp.org

  

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

restrict 210.72.145.44 nomodify notrap noquery

restrict 202.112.10.36 nomodify notrap noquery

restrict 59.124.196.83 nomodify notrap noquery


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

server  127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

------------------------------------------------------------------------------------------- 

#service ntpd start



2、配置内网NTP-Clients

# yum install ntp

# chkconfig ntpd on

# chkconfig --list ntpd

#vim /etc/ntp.conf

------------------------------------------------------------------------------------------- 

driftfile /var/lib/ntp/drift

restrict 127.0.0.1

restrict -6 ::1

# 配置时间服务器为本地的时间服务器

server 192.168.1.135

restrict 192.168.1.135 nomodify notrap noquery

server  127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

------------------------------------------------------------------------------------------- 

#service ntpd start

手动同步服务器时间

ntpdate -u 192.168.1.135


硬件时间与系统时间一起同步

# vim /etc/sysconfig/ntpd

SYNC_HWCLOCK=yes




 本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1717524,如需转载请自行联系原作者




相关文章
|
17天前
|
弹性计算 安全 Ubuntu
新手3分钟1Panel安装教程,使用阿里云服务器CentOS操作系统
在阿里云CentOS 7.9服务器上安装1Panel面板,包括远程连接ECS、执行安装命令、设置安装目录(默认/opt)、开启20410端口、配置安全入口和用户密码。记得在阿里云安全组中开放20410端口以访问面板。
新手3分钟1Panel安装教程,使用阿里云服务器CentOS操作系统
|
1月前
|
Perl
Centos8同步时间(阿里云NTP服务为例)
Centos8同步时间(阿里云NTP服务为例)
122 1
|
23天前
|
缓存 Linux 开发工具
centos设置ntp服务同步目标服务器时间
【7 月更文挑战第 1天】linux+centos设置ntp服务同步目标服务器时间
|
1月前
|
NoSQL 关系型数据库 应用服务中间件
jdk1.8、mysql、redis、nginx centos云服务器安装配置
jdk1.8、mysql、redis、nginx centos云服务器安装配置
|
1月前
|
Linux
Centos7同步时间(阿里云NTP服务为例)
Centos7同步时间(阿里云NTP服务为例)
323 0
|
2月前
|
Linux 数据库
ntp如何配置同步服务器
【5月更文挑战第19天】ntp如何配置同步服务器
90 2
|
2月前
|
网络协议 物联网 Linux
你不能不知道的:无公网IP,SSH远程连接CentOS服务器【内网穿透】
你不能不知道的:无公网IP,SSH远程连接CentOS服务器【内网穿透】
154 0
|
2月前
|
Linux 网络安全 数据库
linux centos系统搭建samba文件服务器 NetBIOS解析 (超详细)
linux centos系统搭建samba文件服务器 NetBIOS解析 (超详细)
|
2月前
|
Linux 数据库
ntp如何配置同步服务器
【5月更文挑战第24天】ntp如何配置同步服务器
96 0
|
2月前
|
存储 安全 网络协议
云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南
云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南
83 0