Setup NTP Linux datetime

Posted: เมษายน 2, 2010 in ไม่มีหมวดหมู่

Synchronize the System Clock

It is a good idea to synchronize the system clock with an NTP (network time protocol) server over the Internet. Simply run

aptitude install ntp ntpdate

Configure Timezone

Find your timezone file under /usr/share/zoneinfo. For example:


Create a symbolic link from the appropiate timezone to /etc/localtime.

ln -sf /usr/share/zoneinfo/Asia/Bangkok /etc/localtime

Configure NTP Server

The configuration file for ntpd is located at /etc/ntp.conf. The
default Ubuntu file probably requires some modification for optimal performance.You need to edit the /etc/ntp.conf file using the following command

vi /etc/ntp.conf


Now Restart ntp service using the following command

/etc/init.d/ntp restart

Set the hardware clock to the system time:

/sbin/hwclock –systohc



Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s