How to sync time on CentOS

Install Network Time Service (ntp) & ntpdate clients:

# yum install ntp ntpdate

Start ntpd service:

# systemctl enable ntpd
# systemctl start ntpd

Check status

# service ntpd.service status

Configure ntp servers:

# ntpdate -u -s 0.centos.pool.ntp.org 1.centos.pool.ntp.org 2.centos.pool.ntp.org 3.centos.pool.ntp.org

Check the sync status:

# timedatectl status

Finally, set the Hardware Clock from the System Clock

# hwclock -w

@source:

https://www.ntppool.org/en/use.html

https://manpages.courier-mta.org/htmlman8/hwclock.8.html

Leave a Reply