Boring tonight, learning to build a Linux time server, in fact, quite simple, this article is mainly a summary of my, we can learn from it.
Required Packages:NTP
Configure Server-side
1, first check whether the NTP package is installed, check the command Rpm-qa | grep ntp or yum list | grep NTP
2, confirm the installation of the NTP package, to set up a local time server, only need to modify the/etc/ntp.conf file in a few simple configuration can be, vi/etc/ntp.conf
Just add on who can send a request to this server to update the time.
Restrict 192.168.100.0 mask 255.255.255.0 nomodify (allow intranet communication)
Restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap noquery notrust (block other IP over update time)
Description: About the Permission settings section
The setting of the permission is mainly set by the Restrict parameter, the main syntax is:
restrict IP address or domain name mask subnet mask option
Where IP can be an IP address or default, default means all IP.
Common options are as follows:
Ignore: Indicates that the NTP request packet is forbidden to enter
nomodify: Indicates that other computers are prevented from changing the native NTP service settings, but can be used through this NTP server for network
notrust: Disallowed, so unauthenticated NTP packets are not entered
Noquery: Indicates that other computers are prevented from querying the state of the native NTP service
If no option is set, it means that the computer (or network) has no restrictions
As for the server time update, the configuration file has been written,
Server 0.pool.ntp.org
Server 1.pool.ntp.org
Server 2.pool.ntp.org
Here there is no need to modify, as to the specific situation, today is too tired, to write a specific tomorrow.
Configuration of the Client
The client wants to synchronize time, only need to use a command to be able to ntpdate IP .
Concrete things, add again tomorrow.
This article is from the "focus on Java,linux Technology" blog, please be sure to keep this source http://wuqinglong.blog.51cto.com/9087037/1618328
Build a Linux time server