How to adjust the incorrect time synchronization in Linux?

To adjust the time synchronization on Linux, you can follow these steps:

  1. Manually synchronize time using the ntpdate command: Open the terminal, and run the following command with root privileges:
ntpdate time.nist.gov

This will obtain the current time from the time.nist.gov server via NTP (Network Time Protocol) and apply it to the system.

  1. Set up NTP service: The NTP service can automatically synchronize time. Edit the NTP configuration file (usually located at /etc/ntp.conf) with root permissions, and add or modify the following line to specify the NTP server.
server time.nist.gov

After saving the changes, restart the NTP service to make them take effect.

sudo service ntp restart
  1. Set the time using the timedatectl command: timedatectl is a command line tool for managing system time and date. Run the following command with root privileges:
timedatectl set-time 'YYYY-MM-DD HH:MM:SS'

Replace YYYY-MM-DD HH:MM:SS with the correct date and time.

These methods should be able to assist you in adjusting the time synchronization of your Linux system.

bannerAds