Configure Time – CentOS Linux

Procedure: Setup NTPD on CentOS Linux

Open the terminal or login over the ssh session. You must login as as the root user. Type the following yum command to install ntp
# yum install ntp ntpdate ntp-doc

Turn on service, enter:
# chkconfig ntpd on

Synchronize the system clock with 0.pool.ntp.org server (use this command only once or as required):
# ntpdate pool.ntp.org

Start the NTP server. The following will continuously adjusts system time from upstream NTP server. No need to run ntpdate:
# /etc/init.d/ntpd start

Configure ntpd (optional)

Edit /etc/ntp.conf, enter:
# vi /etc/ntp.conf

To set your timezone – 

There are a bunch of files stored by region in the following directory:

/usr/share/zoneinfo

Take a look and find the one which matches your region. Then you have to create a symlink from /etc/localtime:

sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/Europe/London /etc/localtime

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.