Set up an NTP time server in Linux

Source: Internet
Author: User
In Linux, the NTP time server 1NTP introduction NTP (NetworkTimeProtocol network time protocol) is a network protocol used to synchronize computer clock. It enables the computer to synchronize time with other servers or clock sources for high-precision time correction. In short, NTP Linux builds an NTP Time server 1. NTP introduction NTP (Network Time Protocol) is a Network Protocol used to synchronize computer clock. It enables the computer to synchronize time with other servers or clock sources for high-precision time correction. In short, NTP enables time synchronization between one or more servers (clients) and time servers (servers) to ensure time uniformity. the time synchronization between the client and the server is mentioned above when the NTP server is set up. now we will first set up the NTP server (that is, the NTP time server) 2.1 system environment OS: Debian 7.0 amd64source: deb http://ftp.debian.org/debian Wheezy main contrib non-free2.2 sets up NTP server 2.2.1 install NTP service software # aptitude install ntp2.2.2. edit ntp configuration file # nano/etc/ntp. the simplest configuration of conf is to modify the following information: restrict 192.168.0.0 mask restart 255.0.0 nomodify notrap and save and exit to 2.2.3 restart NTP service # invoke-rc.d ntp restart so that the NTP time server is set up 2.3 client configuration NTP time server has, so how does the client synchronize time with this server ?, We will continue to install the time synchronization program client 2.3.1 # aptitude install ntpdate2.3.1 to synchronize the time between the client and the time server (192.168.61.85) # ntpdate 192.168.61.85 if the following prompt appears after executing the command, ntpdate [23636]: adjust time server 192.168.61.85 offset-0.052088 sec2.3.2, then we need to add the scheduled task # crontab-e in the last line to add the following content: 0 1 ***/usr/sbin/ntpdate 192.168.61.85 synchronize time at every day, the establishment and use of the NTP time server is over. The following describes the configuration of NTP. conf in the ntp configuration file. it is for reference only: zookeeper in the configuration file/etc/ntp. conf mainly includes the following parameters: 1. restrict <子网掩码> | <网段> <子网掩码> [Ignore | nomodify | noquery | notrap | notrust | nokod]: specify the IP address or network segment for NTP communication 1.1 ignore: disable all NTP services 1.2 nomodify: the client cannot change the time parameter of the NTP server. However, the NTP server can be used for time verification. 1.3 noquery: NTP service 1.4 notrap is not provided. trap remote event logon function is not provided. 1.5 notrust: the 1.6 kod: kod technology of the client that has not passed the authentication can organize the damage to the server caused by the "Kiss of Death" package (a DOS attack). This parameter will enable this function 1.7 nopeer: if no option is specified for time synchronization with other NTP servers at the same layer, it means that the specified client has no restrictions when accessing the NTP server. server [IP | FQDN] [prefer]: specifies the upper-layer NTP server of the NTP server. if there are multiple upper-layer NTP servers, perform time synchronization based on the prefer priority, the smaller the prefer, the higher the priority. 3. broadcast subnet mask: specifies the network segment for NTP time broadcast. If this parameter is not specified, the NTP server displays time synchronization information for all IP address segments that can be accessed: # Some parameters in ntpq-p are described as follows: remote: The NTP server connected to the local host st: NTP server priority when: The last time the NTP server was synchronized (unit: s) poll: the time (in seconds) for the next synchronization with the NTP server delay: The time required to complete the entire synchronization from the local time synchronization command to the remote time server (unit: 10 ^-6 s) offset: The time difference between the local host and the time server (which will be automatically corrected after synchronization) jitter: the distribution statistics value of an offset. the smaller the value, the more accurate the time.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.