Skip to content

Instantly share code, notes, and snippets.

@yiidtw
Last active February 16, 2019 17:44
Show Gist options
  • Save yiidtw/901a7c7fee4b0d84ca846d9a89b77231 to your computer and use it in GitHub Desktop.
Save yiidtw/901a7c7fee4b0d84ca846d9a89b77231 to your computer and use it in GitHub Desktop.
install and configure ntpd on centos7
# http://www.stdtime.gov.tw/chinese/bulletin/NTP%20promo.txt
sudo yum install -y ntp
sudo sed -i "s/server 0.centos.pool.ntp.org iburst/server time.stdtime.gov.tw prefer/g" /etc/ntp.conf
sudo sed -i "s/server 1.centos.pool.ntp.org iburst/server tick.stdtime.gov.tw/g" /etc/ntp.conf
sudo sed -i "s/server 2.centos.pool.ntp.org iburst/server tock.stdtime.gov.tw/g" /etc/ntp.conf
sudo sed -i "s/server 3.centos.pool.ntp.org iburst/server clock.stdtime.gov.tw/g" /etc/ntp.conf
sudo ntpdate time.stdtime.gov.tw # must nptdate before ntpd start, otherwise the port would be occupied by ntpd
sudo systemctl start ntpd && sudo systemctl enable ntpd
date -R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment