Q. How do I install and configure NTP under CentOS Linux 5 server to synchronize the system clock?
A. You can easily install NTP (Network Time Protocol, a means of transmitting time signals over a computer network) using yum command under Redhat or CentOS/Fedora core Linux.
Procedure
Login as the root user
Type the following command to install ntp
# yum install ntp
Turn on service
# chkconfig ntpd on
Synchronize the system clock with 0.pool.ntp.org server:
# ntpdate pool.ntp.org
Start the NTP:
# /etc/init.d/ntpd start
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 33 comments… read them below or add one }
Nice inof, but how do i configure a NTP server? i want to do this with a client and a server… Thanks
Thanks, very straight forward.
This helped me to fix my call of duty world at war server problem.
Thank you.
Does anyone know how to make it run ntpdate at certain time increments?
Like every hour?
Thanks
Setup a cronjob.
Good info, very helpful.
Thanks!
Thanks, very simple to install and configure. My time is synchronized now.
nice information but please tell me about the client end that how i sync time server with clients
See: CentOS / Red Hat Configure an NTP Client And Server
thanks man
very nice
I did ntpdate 0.asia.pool.ntp.org
and now all my servers showing different time. Any idea why
server1 – Wed Jan 6 15:54:10 IST 2010
server2 – Wed Jan 6 15:47:39 IST 2010
server3 – Wed Jan 6 15:58:23 IST 2010
For more infomation – My servers are in India
Thanks in advance
@Kunal,
My guess: You are obtaining your time info from a pool, so each time you synchronize you’re really getting your time form a different server. This shouldn’t matter, but it seems that the different servers in that pool are not synchronized with each other. You could pick a single server out of the pool and synchronize with it directly on each of your servers.
Or, even better, set up your own ntp server, have it synchronize with a quality outside time server, then have the rest of your servers sync up with the time server that you installed. That way, even if there’s an accuracy problem upstream, at least all of your servers will agree with each other.
I have this error:
ntpdate[14060]: step-systime: Operation not permitted
This is likely related to the server being a virtual server. It is not possible to sync to ntp in a VPS because the clock is inherited from the hardware that you are hosted on.
I just ran across the same problem.
Very useful
Very Helpful :)
Replying @Anonymous June 4, 2010
Actually if you mean a Xen VM, you still can have your own independent system clock setting the following sysctl parameter.
sysctl -w xen.independent_wallclock = 1;
And you save it inside /etc/sysctl.conf
Thanks for this tip!
Thanks you for your instructions.
This is exactly what I was looking for. Thank you for this clear post. :)
Thank you this was very helpful!
i have configured ntp server on my machine which runs rhel6
but at the client side at the time of ntp setting it giving me error tha
server is note reachable or doesn’t act as a ntp server and also i cant
see the port of ntp is open on my system, will you please help me for this
Thanks
Thanks but setting up / configuriing ntp servers list would be useful also
Thank you very much, it was exactly as you said.
Thanks a lot. great howto…
i am from Malaysia. which server should i use ?
Great post ,, and it works as a charm :) ,, thank you very much
Thanks a lot for your concise post.
The following command will additionally update your hardware clock
hwclock –systohc
Very helpful. Thanks
You dont need to have an ntp server running in your machine in order to have the time synced, it is as easy as having cron do the syncing with the ‘ntpclient’ command.
Hi Fred,
Could you please share script to sync with ntp server. so that i can run the same as a cron job.
Thank you much.