1. Check your current system time
#date
If the date/time is wrong, continue below.
- Make sure NTP (Network Time Protocol) is installed and running
On CentOS / CloudLinux / RHEL
Install NTP:
#yum install ntp -y
Start and enable it:
#systemctl enable ntpd
#systemctl start ntpd
On AlmaLinux / Rocky Linux:
dnf install chrony -y
systemctl enable chronyd
systemctl start chronyd
On Ubuntu / Debian
apt install chrony -y
systemctl enable chrony
systemctl start chrony
- Force sync time manually
Using ntpdate (if installed):
ntpdate pool.ntp.org
Or for Chrony:
chronyc makestep
- Verify time sync
timedatectl status
Ensure:
System clock is accurate
NTP service: active
Time synchronized: yes