Linux Server time synchronization Setup method

Source: Internet
Author: User
Tags vps

Let me introduce the relevant tutorials

The following commands need to be executed with root permission, or you will be prompted for insufficient permissions

First determine if the server has ntpdate this software:

Which ntpdate if not found, you will need to install a ntpdate.

Use this command under Redhat, CentOS:

The code is as follows Copy Code

Yum Install-y NTP

Use this command under Debian and Ubuntu:

The code is as follows Copy Code

Apt-get install-y Ntpdate

After installation, execute the following command to obtain accurate time via the service server

Ntpdate-u pool.ntp.orgpool.ntp.org


is a set of timing server virtual cluster, in the world has more than 3,000 servers, only need to write on the line, specifically which server to provide services without concern.

If there is a similar error following the execution of the command, the VPS does not allow the VPS to set its own time:

9 05:13:57 ntpdate[7299]: Step-systime:operation not permitted

After the computer runs for some time, the time is likely to produce some deviations, so it also requires regular synchronization time, then use the crontab to carry out the command on a regular basis, such as: 1 o'clock in the morning every day to perform


The command for synchronization time is: ' Ntpdate timeserver ' here the timeserver for the time server IP or hostname, commonly used timeserver have 210.72.145.44, time.windows.com ( Windows Time server). If you want to sync every 6 hours, specify a scheduled task.

*/6 * * * */usr/sbin/ntpdate 210.72.145.44 >/dev/null

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.