jump to navigation

Install – configure NTP and set the timezone on CentOs 5.x January 14, 2011

Posted by Tournas Dimitrios in Linux.

This is just a brief howto about installing and configuring NTPD (Network Time Protocol Daemon) on a Linux server . First we will install ntpd, then update the current time on the server, configure ntpd to restart on server boot, and then start ntpd .Last but not least the timezone will be set .

Network time protocol (NTP) is a communication protocol that syncs computers over the network. NTP syncs the time so all computers on the network do not have incorrect clock values. Improper time stamps on files and folders can cause a problem for network administrators, so NTP is used to keep all clients up to the second.

Installing ntpd :

  1. Run the below command to install ntpd via yum.
    [root@server ~]# yum install ntp
  2. Set NTPD to Start: Update chkconfig to have ntpd start when the server restarts.
  3. [root@server ~]# chkconfig ntpd on
    [root@server ~]# chkconfig –list | grep ntp

  4. Update Server Time: Use rdate to set the server time. Install it if it is not already installed.
    [root@server ~]# yum install rdate
    [root@server ~]# rdate -s cuckoo.nevada.edu
  5. Start NTPD: Run the below command to start NTP (Network Time Protocol).
    [root@server ~]# service ntpd start
    Use the below command to verify NTPD is now running. You should see output similar to what is below the ps command.
    [root@server ~]# ps -ef | grep ntp
    ntp 15120 1 0 21:50 ? 00:00:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
    root 20420 19746 0 22:44 pts/3 00:00:00 grep ntp

Configuring the timezone :

As usual , Linux has many ways to achieve the same result . It’s up to the user to select the method that is the most convenient to him .From the terminal use one of the following configuration methods .

  1. System-config-date : go to the timezone tab and select your timezone
  2. setup : with your arrow keys select the timezone option
  3. tzselect  :  This utility is part of the glibc-common package , so if not available , install the  package  first ( yum install glibc-common) . tzselect is an interactive terminal utility , just follow the steps and make the appropriate selections


No comments yet — be the first.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s