如何讓centos的時間與網絡時間服務器同步

安裝ntp服務 

sudo yum install ntp

sudo systemctl enable ntpd

修改NTP配置

vi /etc/ntp.conf

將時間服務器換成國內的

server 0.cn.pool.ntp.org
server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org
server 3.cn.pool.ntp.org

重啓NTP服務

sudo systemctl restart ntpd

檢查時間是否同步

date

 

參考

https://www.howtogeek.com/tips/how-to-sync-your-linux-server-time-with-network-time-servers-ntp/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章