ติดตั้ง NTP Client ให้ CentOS อัพเดตเวลาอัตโนมัติ

0
4755
CentOS Cover

หากท่านต้องการให้เซิฟเวอร์ CentOS มีการอัพเดตเวลาโดยอัตโนมัติจาก NTP Server เพื่อให้เวลาเที่ยงตรงอยู่เสมอ ต้องดำเนินการติดตั้ง NTP Client ด้วยคำสั่งดังต่อไปนี้

yum -y install ntp

จากนั้นแก้ไขไฟล์​ config ที่ /etc/ntp.conf โดยเพิ่มบรรทัด server th.pool.ntp.org เข้าไปในไฟล์ดังกล่าว
อาจใช้ nano text editor ก็ได้ เช่น

nano /etc/ntp.conf

สั่ง restart ntp เพื่อให้ทำงานด้วย config ที่มีการแก้ไขไว้

service ntpd restart
chkconfig ntpd on

สามารถตรวจสอบการทำงานของ ntp service ได้โดย

ntpq -pn

LEAVE A REPLY

Please enter your comment!
Please enter your name here