Howto Setup NTP on CentOS

From Brian Nelson Ramblings
Jump to: navigation, search

Howto Setup NTP on CentOS

Keeping your system’s date and time accurate is easy to do using NTP.

Having an accurate clock on your server ensures that time stamps in emails sent from your machine are correct. An accurate clock is especially helpful when you need to look at the logs from a particular time of day.

If you don't occasionally set the system clock yourself, the time will slowly drift away from a perfectly accurate setting. That's when the network time protocol (NTP) is useful.

What is NTP?

NTP lets you automatically sync your system time with a remote server. The NTP can be used to update the clock on a machine with a remote server. This keeps your machine's time accurate by syncing with servers that are known to have accurate times. NTP also keeps the clocks on several machines in sync, thus making it easier to match log entries for an event across multiple servers.

It's easy to set up an NTP server to regularly adjust your machine's clock. It's also possible to make it a bit more complicated if you need your clock accurate down to the millisecond instead of just to the second.

Install NTP with Yum

yum install ntp

Now lets make it auto start up

chkconfig ntpd on

Start the ntp deamon

/etc/init.d/ntpd start