Configure Network Time Protocol (NTP) on CentOS 6.3

Share this Article :

Linux LogoAs opposed to the manual setup, it is possible to synchronize the system clock with a remote server over the Network Time Protocol (NTP). NTP is an Internet protocol used to synchronize the clocks of computers or servers to some NTP server on internet or intranet.

Steps A
1. To synchronization immediately or for the one-time synchronization only, use the ntpdate command as below :

[[email protected] ~]# ntpdate -q

2. Enable running the ntpdate at boot time:

[[email protected] ~]# chkconfig ntpdate on

Steps B
However, there are alternative way to set the ntpd daemon to synchronize the time at boot time automatically :

Also Read :   How to Print Unique Lines from a File?

1. Install ntpd service daemon :

[[email protected] ~]# yum install ntp -y

2. Open the NTP configuration file /etc/ntp.conf :

[[email protected] ~]# vi /etc/ntp.conf

3. Now add or edit the list of public NTP servers.


4. Set the proper permissions, giving the unrestricted access to localhost only:

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict -6 ::1

5. Restart the NTP daemon:

[[email protected] ~]# service ntpd restart
Shutting down ntpd:                                        [  OK  ]
Starting ntpd:                                             [  OK  ]

6.Set ntpd daemon is started at boot time :

[[email protected] ~]# chkconfig ntpd on

One Response

  1. Rami Nairab

Leave a Reply