Showing posts with label ntd. Show all posts
Showing posts with label ntd. Show all posts

Monday, March 2, 2020

Syncing Time in CentoOS 7 (ntp/chrony)

For some reason, I couldn't get this to sync until I finally found 1 command that everyone never mentioned.  Here's how to set it up.

ntpd

  1. yum install ntp ntpdate
  2. systemctl start ntpd
  3. systemctl enable ntpd
  4. systemctl status ntpd
  5. ntpdate -u -s 0.centos.pool.ntp.org 1.centos.pool.ntp.org 2.centos.pool.ntp.org
  6. timedatectl set-ntp yes
  7. timedatectl set-ntp 1
  8. systemctl restart ntpd

chronyd
  1. yum install chrony
  2. systemctl enable chronyd
  3. systemctl start chronyd
  4. ntpdate pool.ntp.org
  5. timedatectl set-ntp yes
  6. timedatectl set-ntp 1
  7. systemctl restart chronyd


ShareThis