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,如需转载请自行联系原作者




相关文章
|
9天前
|
NoSQL Linux Redis
在 centos7 下重启/开启 redis 服务器
本文提供了一种在Centos 7操作系统下如何重启Redis服务器的步骤,包括停止Redis服务、确认停止成功以及重新启动Redis服务。
16 2
在 centos7 下重启/开启 redis 服务器
|
7天前
|
Linux 数据安全/隐私保护 Windows
centos 7.2 搭建svn服务器
centos 7.2 搭建svn服务器
27 0
|
1月前
|
网络安全
构建 NTP 时间服务器
构建 NTP 时间服务器
80 2
|
2月前
|
存储 安全 Linux
新 CentOS 7 服务器的基本配置
新 CentOS 7 服务器的基本配置
49 1
|
2月前
|
运维 网络协议 Linux
揭秘CentOS 7:系统目录奥秘大起底,网卡配置秒变高手,让你的服务器管理飞一般的感觉!
【8月更文挑战第5天】CentOS 7作为RHEL的社区版本,以其稳定性和丰富功能广受好评。本文通过案例分析介绍其系统目录结构及网卡配置方法。系统目录如/(根)、/bin(基本命令)、/boot(启动文件)、/dev(设备文件)、/etc(配置文件)、/home(用户目录)和/lib(共享库)等各司其职。网卡配置通过编辑/etc/sysconfig/network-scripts/下的ifcfg文件实现,如设置ens33接口的静态IP地址、子网掩码、网关和DNS服务器,并通过重启网络服务使配置生效。这是系统管理员必备的技能之一。
50 2
|
2月前
|
网络协议 Linux Shell
如何在运行Centos 6的虚拟服务器上安装cPanel
如何在运行Centos 6的虚拟服务器上安装cPanel
26 0
|
2月前
|
关系型数据库 MySQL Linux
在 CentOS 7 服务器上安装和保护 phpMyAdmin 与 Apache 的方法
在 CentOS 7 服务器上安装和保护 phpMyAdmin 与 Apache 的方法
52 0
|
2月前
|
Linux 数据安全/隐私保护
在CentOS 7服务器上添加和删除用户的方法
在CentOS 7服务器上添加和删除用户的方法
79 0
|
3月前
|
弹性计算 安全 Ubuntu
新手3分钟1Panel安装教程,使用阿里云服务器CentOS操作系统
在阿里云CentOS 7.9服务器上安装1Panel面板,包括远程连接ECS、执行安装命令、设置安装目录(默认/opt)、开启20410端口、配置安全入口和用户密码。记得在阿里云安全组中开放20410端口以访问面板。
115 0
新手3分钟1Panel安装教程,使用阿里云服务器CentOS操作系统
|
3月前
|
缓存 Linux 开发工具
centos设置ntp服务同步目标服务器时间
【7 月更文挑战第 1天】linux+centos设置ntp服务同步目标服务器时间