测试环境:

NTPserver 192.168.1.252

NTPclient 192.168.1.251

准备工作:

关闭selinux:

vi /etc/selinux/config

SELINUX=disabled

关闭iptables:

service iptables stop

chkconfig iptables off

一.安装NTP软件包:

yum -y install ntp /*yum安装NTP服务*/

chkconfig --add ntpd /*添加NTP*/

chkconfig ntpd on /*开机自启动NTP*/

二.修改NTP配置文件:

vi /etc/ntp.conf
***************************************************************

# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift
restrict default ignore 设置默认策略为拒绝所有访问方式的请求
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap 允许局域网内机器同步时间

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.CentOS.pool.ntp.org
server 1.centos.pool.ntp.org 设置同步服务器
server 2.centos.pool.ntp.org

#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

restrict 0.centos.pool.ntp.org nomodify notrap noquery
restrict 1.centos.pool.ntp.org nomodify notrap noquery 允许与上层服务器同步时间
restrict 2.centos.pool.ntp.org nomodify notrap noquery

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10 外界同步源无法联系时,使用本地时间为同步服务

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loops

***************************************************************

CentOS 6.3下NTP服务安装和配置的更多相关文章

  1. CentOS 6.5 下HeartBeat的安装与配置

    CentOS 6.5 下HeartBeat的安装与配置 参考网站: http://wenku.baidu.com/link?url=BvqJatdx1m12PLil-7YA1zkM0yUOEO8OnN ...

  2. CentOS7下NFS服务安装及配置固定端口

    CentOS7下NFS服务安装及配置 系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1. ...

  3. CentOS 6.6下JDK1.7安装与配置(Linux)经典入门详解案例

    最近用的linux较多,在网站找了一些关于linux环境下jdk安装的教程,过程是有的但是好多细节都没有表现出来,所以我花了点时间总结了一下,希望对大家都有帮助... CentOS下JDK1.7安装与 ...

  4. CentOS 7下Samba服务安装与配置详解

    1. Samba简介 Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成.SMB(Server Messages Block,信息服务块)是一种在局域网上共 ...

  5. CentOS 7.5下KVM的安装与配置

    由于没有物理机可用,在自己的VMware Workstation中CentOS 7.5下搭建完成. 首先查看VMware Workstation是否支持虚拟化,把红框内打钩即可. 虚拟化开启并安装Ce ...

  6. CentOS 6.3下PostgreSQL 的安装与配置

    一.简介 PostgreSQL 是一种非常复杂的对象-关系型数据库管理系统(ORDBMS),也是目前功能最强大,特性最丰富和最复杂的自由软件数据库系统.有些特性甚至连商业数据库都不具备.这个起源于伯克 ...

  7. Linux——CentOS 6.3下PostgreSQL 的安装与配置

    一.简介 PostgreSQL 是一种非常复杂的对象-关系型数据库管理系统(ORDBMS),也是目前功能最强大,特性最丰富和最复杂的自由软件数据库系统.有些特性甚至连商业数据库 都不具备.这个起源于伯 ...

  8. linux下informatica服务安装和配置

    本文中将会用infa简称代替informatica 1.安装前准备 介质名称 版本信息 描述 Informatica Powercenter 9.5.1 for Linux 64 bit 必须 Jav ...

  9. CentOS7下NFS服务安装及配置

    系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1.3.0-0.48.el7_4.x86_ ...

随机推荐

  1. 把excel数据导入mysql中

    适用:每列的数据都不是以逗号分隔. 1.在mysql建表,全部字段与表头相同且顺序一致 2.将excel另存为csv格式,用Editplus把CSV文件另存为UTF-8编码格式 3.执行load da ...

  2. 用python写刷票程序

    刷票一般要突破以下限制: 1.验证码识别 2.同一ip不可连续投票 解决办法 1.用tesseract工具,链接在此 https://code.google.com/p/tesseract-ocr/  ...

  3. qtp中vb脚本,经典收藏

    1.在脚本运行过程中屏蔽鼠标键盘输入 SystemUtil.BlockInput ‘开始处 这里是你的脚本 SystemUtil.UnblockInput ’结尾处 ----------------- ...

  4. Chapter 2 Open Book——15

    The rest of the week was uneventful. I got used to the routine of my classes. 这周剩下的时间都是平淡无事的.我就是正常的上 ...

  5. jsp的九大天王

    JSP中一共预先定义了9个这样的对象,分别为:request.response.session.application.out.pagecontext.config.page.exception 1. ...

  6. POJ 1062 昂贵的聘礼(dij+邻接矩阵)

    ( ̄▽ ̄)" #include<iostream> #include<cstdio> #include<cstring> #include<cstd ...

  7. Broken Keyboard(悲剧文本)

    你有一个键盘,键盘上所有的键都能正常使用,只是Home键和End键有时会自动按下.你并不知道这一情况,而是专心地打稿子,甚至连显示器都没开电源.当你打开显示器之后,展现在你面前的是一段悲剧文本.你的任 ...

  8. oracle即时客户端安装方法

    http://blog.csdn.net/magicboylinw/article/details/7025885 Oracle Instant Client(即时客户端) 安装与配置 oracleO ...

  9. vs远程调试

    一.远程       建立共享目录debug 二.本地 1.生成->输出->输出路径,由"bin\Debug\"改为远程目录"\\xxx\\debug&quo ...

  10. Openlays 3 绘制基本图形

    <body> <div id="menu"> <label>几何图形类型:</label> <select id=" ...