How to configure NTP Client in Linux?

If you are running a dedicated server and seems server’s time is delayed or is ahead of the actual time, we can use NTP to solve it.

# yum install ntp
# ntpdate pool.ntp.org

or

# ntpdate 0.fedora.pool.ntp.org
You can also add it to /etc/cron.daily to check correct Date/Time.
# cd /etc/cron.daily/

# vim ntp.sh

#!/bin/bash

/usr/sbin/ntpdate pool.ntp.org

Save and exit the file. Now, make it as a executable by,

# chmod 755 /etc/cron.daily/ntp.sh

Finally restart the cron daemon.

# service crond restart

one comment

  1. Bradford says:

    Thanks, this was perfect.

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.