ntp服务配置【上海时时乐走势图】

server 3.centos.pool.ntp.org iburst

server 192.168.66.131 prefer

# Please consider joining the pool ().

 

 

 

 

# Use public servers from the pool.ntp.org project.

 

#multicastclient 224.0.1.1              # multicast client

#broadcastclient                        # broadcast client

 

 

 

#controlkey 8

#requestkey 8

# with symmetric key cryptography.

B.配置/etc/ntp/step-tickers文件

server 2.rhel.pool.ntp.org iburst

# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

keys /etc/ntp/keys

# be tightened as well, but to do so would effect some of

 

# For more information about this file, see the man pages

是因为ntp服务要求使用到UDP端口号为123,所以当系统的防火墙(iptables)运行的处境下,必得开放UDP端口号123

server 1.centos.pool.ntp.org iburst

 

自己商议ntp是或不是开机运转:[root@localhost ~]# chkconfig --level 35 ntpd on

 

server 0.centos.pool.ntp.org iburst

  1)设定NTP主机来源(在那之中prefer表示优先主机),192.168.66.131是地面包车型大巴NTP服务器,所以优先钦命从该主机同步时间

  NTP server的关键布署文件为/etc/ntp.conf,未有退换过的ntp。conf文件内同如下:

  2)限制你同意的那些服务器的拜见类型,在此个例子中的服务器是不容许修改运营时安插只怕查询您的linux ntp服务器

fontpackages-filesystem-1.41-1.1.el6.noarch

    restrict 127.0.0.1

server 192.168.66.131 prefer

启动NTP服务

# Key file containing the keys and key identifiers used when operating

# Specify the key identifiers which are trusted.

server 3.centos.pool.ntp.org iburst

 

C.配置/etc/sysconfig/ntpd文件

includefile /etc/ntp/crypto/pw

server 1.rhel.pool.ntp.org iburst

[root@localhost ~]# more /etc/ntp/step-tickers

 

 

 

server 1.centos.pool.ntp.org iburst

 

server 3.rhel.pool.ntp.org iburst

 

ntp-4.2.6p5-10.el6.centos.2.i686

# the administrative functions.

#manycastserver 239.255.254.254         # manycast server

 

  3)确认保证localhost有丰富权限,使用未有其余限制器重词的语法

# Permit all access over the loopback interface.  This could

server 2.centos.pool.ntp.org iburst

restrict -6 ::1

restrict -6 default kod nomodify notrap nopeer noquery

service ntpd status

#statistics clockstats cryptostats loopstats peerstats

server 2.centos.pool.ntp.org iburst

ntpdate-4.2.6p5-10.el6.centos.2.i686

# permit the source to query or modify the service on this system.

 

restrict default kod nomodify notrap nopeer noquery

# Hosts on local network are less restricted.

以上的掩码地址扩展为255,由此从192.168.1.1-192.168.1.254的服务器都足以动用大家的NTP服务器来共同有时候间

#broadcast 192.168.1.255 autokey        # broadcast server

#manycastclient 239.255.254.254 autokey # manycast client

server 0.centos.pool.ntp.org iburst

#crypto

NTP的配置

 

 

#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# List of servers used for initial synchronization.

安装NTP包

restrict 127.0.0.1

# Permit time synchronization with our time source, but do not

上述是通过了vi修改

#安装私下认可计策为允许任何主机进行时间共同

netstat -lntup|grep ntp

[root@localhost ~]# more /etc/ntp.conf

service ntpd start

ntp服务,默许智慧共同系统时间。倘若让ntp同有时间一同硬件时间,能够设置/etc/sysconfig/ntpd文件,在/etc/sysconfig/ntpd文件中增进,SYNC_HWCLOCK=yes那样,就可以让硬件时间与系统时间同步同步。

server 0.rhel.pool.ntp.org iburst

 

IPTABLES配置

 

#broadcast 224.0.1.1 autokey            # multicast server

A.配置/etc/ntp.conf

 

# Enable writing of statistics records.

 restrict default ignore

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

[root@localhost ~]# rpm -qa |grep ntp

修改/etc/ntp/step-tickers文件,内容如下(当ntp服务运行时,会自行与该公文中记录的上层NTP服务开展时间查对)

restrict -6 ::1

# Enable public key cryptography.

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

反省是或不是安装了ntp相关包。若是设置ntp相关包,使用rpm也许yum安装,极其轻易。

#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

#trustedkey 4 8 42

driftfile /var/lib/ntp/drift

  在linux系统中,为了幸免主机时间因为长日子运作下所导致的年华不是,举办时间共同(synchronize)的专门的学业是那多少个供给的。linux系统下,平常采取ntp服务来一块差别机器的年月。NTP是网络时间切磋(Network Time Protocol)的简称,正是经过网络合同使计算机之间的年月同步化。

本文由上海时时乐走势图发布于上海时时乐走势图,转载请注明出处:ntp服务配置【上海时时乐走势图】

您可能还会对下面的文章感兴趣: