Configure NTP date-time synchronization on Linux

Source: Internet
Author: User

Configure NTP time synchronization on Linux with a break operation step, sorted as follows:

1. Install packages (on server and client):

The code is as follows Copy Code
Yum Install NTP

2. Server-side configuration
For example:
First, the server IP address is set to: 192.168.146.110

Modifying the NTP configuration file

The code is as follows Copy Code

Vim/etc/ntp.conf
Server 0.redhat.pool.ntp.org//set up Superior servers
Restrict 192.168.146.0 mask 255.255.255.0 nomodify//Set which client machines can be synchronized with the NTP server

Manually correct one time before starting the NTP service
Ntpdate 0.redhat.pool.ntp.org
Service NTPD Restart
Chkconfig ntpd on

View NTP service status
Netstat-ln | grep 123
Ntpstat

3. Client Configuration:

The code is as follows Copy Code
Ntpdate 192.168.146.110//sync time with NTP server

or synchronize periodically

  code is as follows copy code
crontab  -E
*/5 * * * */usr/sbin/ntpdate -u 192.168.146.110    //sync every five minutes
   restart Cron D Service/etc/init.d/crond Restart
ntpq-p//view sync status

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.