Friday, February 20, 2009

How to sync or set date and time using ntpdate

First install ntp from yum

# yum install ntp

1. chkconfig ntpd on

This turns on ntpd for runlevel 2345

2. ntpdate us.pool.ntp.org
This initializes your clock to the US pool. Please use appropriate country pool, go to www.ntp.org as Mr C suggested.

3. service ntpd start
This starts the ntpd service

4. hwclock --systohc
This syncs the hardware clock to current time

The default settings in /etc/ntp.conf should work for most people. For more information, just man ntp.conf.

No comments: