Last active
February 16, 2019 17:44
-
-
Save yiidtw/901a7c7fee4b0d84ca846d9a89b77231 to your computer and use it in GitHub Desktop.
install and configure ntpd on centos7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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