Configuring time synchronization via the NTP protocol in CentOS

To configure time synchronization via NTP in CentOS:

  1. Open the operating system console.
  2. Check the status of the standard time synchronization service known as chrony. To do so, enter the following command:

    systemctl status chronyd

  3. If the service is not found, enter the following commands to add the package and enable the service:

    sudo dnf install chrony
    sudo systemctl enable chronyd
    sudo systemctl start chronyd

  4. Open the service configuration file. To do so, enter the following command:

    sudo mcedit /etc/chrony.conf

  5. Specify the NTP servers that will be used for time synchronization. To specify the server, you only need to add the following string:

    server <server name or IP address> iburst

  6. Save and close the configuration file.
  7. Restart the service. To do so, enter the following command:

    sudo systemctl restart chronyd

  8. Verify that the specified NTP servers are on the list of synchronization sources. To do so, enter the following command:

    chronyc sources

Page top