当我们需要管理多台服务器的时间时,一台一台的修改未免太麻烦了,NTP服务就很好的为我们解决了这个问题!

1.首先安装NTP

[root@localhost /]# yum install ntp -y

2.修改NTP配置文件,添加NTP服务器的网络位置    /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# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default 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 ::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 192.168.1.1 iburst       #目标服务器网络位置
#server 1.centos.pool.ntp.org iburst     #一下三个是CentOS官方的NTP服务器,我们注释掉
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst#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# Enable public key cryptography.
#cryptoincludefile /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 loopstats peerstats# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.
disable monitor

保存退出

3.启动服务并设置开启自启

[root@localhost /]# systemctl start ntpd.service  #启动服务[root@localhost /]# systemctl enable ntpd.service  #设置为开机启动

4.查看运行状态

[root@localhost /]# systemctl status ntpd.service
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since 二 2016-10-11 13:34:11 CST; 8min ago
 Main PID: 6497 (ntpd)
   CGroup: /system.slice/ntpd.servicess
           └─6497 /usr/sbin/ntpd -u ntp:ntp -g

10月 11 13:34:11 localhost.localdomain ntpd[6497]: Listen and drop on 1 v6wildcard :: UDP 123
10月 11 13:34:11 localhost.localdomain ntpd[6497]: Listen normally on 2 lo 127.0.0.1 UDP 123
10月 11 13:34:11 localhost.localdomain ntpd[6497]: Listen normally on 3 eno16777736 192.168.100.100 UDP 123

可以看到当前的状态为 running

转载于:https://www.cnblogs.com/duolaameng/p/6020673.html

linux时间同步ntp服务的安装与配置相关推荐

  1. linux系统上安装ntp服务,linux时间同步ntp服务的安装与配置

    NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各个计算机的时间的协议. 1.安装ntp服务,要使用时间同步.那么服务端与客户端都需要使用如下命令安装NTP软件包 ...

  2. linux smb 服务找不到,Linux下SMB服务的安装与配置

    转自 http://hi.baidu.com/duangonghua/item/f1b3364e55fa9be81f19bc25 SMB介绍: 用于网络文件共享. 一.下载或从光盘上找到SMB服务安装 ...

  3. linux 银河麒麟V10 VSFTPD服务端安装、配置的图文教程

    前言:本篇文章,集互联网好友的成果.本菜鸟实践摸索的结果,整理综合而得.本人在CSDN.百度.B站等各大网站进行了有限的搜索,都没有看到完全适配的答案. 如果你也是国产电脑的受"益" ...

  4. linux dhcp 服务失败,Centos7安装及配置DHCP服务,安装程序配置服务失败

    Centos7安装及配置DHCP服务,安装程序配置服务失败 DHCP服务概述: 名称:DHCP  - Dynamic Host Configuration Protocol  动态主机配置协议. 功能 ...

  5. svn服务器端下载linux,Svn linux服务端安装及配置

    Svn服务端安装及配置 安装centos7 用vmware虚拟机安装 关闭selinux防火墙 vim /etc/selinux/config 将SELINUX的值设置为disabled 如果不关,日 ...

  6. Linux下MongoDB的入门安装、配置与启动

    Linux下MongoDB的入门安装.配置与启动 mongo非关系性数据库 查询性能好,数据性不是特别重要的情况下使用 [root@test ~]# tar xf mongodb-linux-x86_ ...

  7. Linux系统下禅道的安装以及配置教程

    Linux系统下禅道的安装以及配置教程 首先查看Linux安装的版本,64的还是32的! 查看Linux版本:[root@localhost ~]# getconf LONG_BIT 1.Linux中 ...

  8. Linux+Apache+MySQL+PHP5的安装与配置与phpBB2论坛的架设

    在现在的网络应用中,Linux+Apache+MySQL+PHP已经成为一个重要的组合应用了.在这里我们以PHP5为例谈一下Linux+Apache+MySQL+PHP5的安装与配置.在经过这样的工作 ...

  9. linux 内核 82540网卡,Linux网卡as4.2 编译安装及配置准备

    Linux网卡as4.2 编译安装及配置准备 [日期:2008-03-28] 来源:Linux公社 作者:Linux整理 [字体:大 中 小] 确定make gcc kernel-devel包必须安装 ...

最新文章

  1. 《C陷阱与缺陷》一导读
  2. 4.3 vsftpd文件共享
  3. Android中的数据传递之Parcelable接口
  4. 调试兼容性该注意的的点
  5. 神经网络的输出层有哪些_深度学习的数学-神经网络、输入层、隐藏层、输出层...
  6. vb html table,VB6.0 如何是用 datatable
  7. [bzoj1497][NOI2006]最大获利_网络流_最小割
  8. HotSpot VM运行时02---VM生命周期
  9. 微信运营:必须收藏的101条万能微信标题公式
  10. 算法:求数组区间的和Range Sum Query - Immutable
  11. Java HttpUtils 请求工具类
  12. 各大快递公司面单号准确性验证的正则表达式
  13. 2016中期中国云计算市场报告
  14. domino前后端彻底分离,请使用最流行的vue、react做开发--国内首创
  15. 814 Div2 C
  16. Android viewpager2 + indicator 实现页面滑动
  17. HashMap 的底层原理
  18. 东南大学计算机学院健在院士,【缅怀】顾冠群院士逝去,计算机界痛失泰斗
  19. arduinopn532模块_零知开源分享-使用PN532串口NFC模块读写NFC卡片
  20. 影响云服务器租用价格的因素有哪些

热门文章

  1. systemtap gui
  2. WebService中运用自定义类的处理要领(转)
  3. Nokia Booklet 3G试用小记
  4. Sqlite优化记录:使用全文索引加快检索速度-转
  5. 定点乘法运算之原码一位乘法
  6. 1017. A除以B (20)-PAT乙级真题
  7. 1038. 统计同成绩学生(20)-PAT乙级真题
  8. 用计算机制作模拟,计算机模拟设计,computer simulation design,音标,读音,翻译,英文例句,英语词典...
  9. python django 优势_为什么选择Django?
  10. asp.net mvc 点滴 一 asp.net mvc vs asp.net web forms