Linux: Sync Time with ntpdate

 

Sync Time using ntpdate

Manual Sync

# sudo as root
sudo su -
 
# Stop ntpd
service ntpd stop
 
# Sync time
ntpdate pool.ntp.org
 
# Start ntpd
service ntpd start

Setup ntpd Server

vi /etc/ntp.conf
 
# Add an entry, e.g. server pool.ntp.org
# Multiple time servers are more accurate:
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org

* Turn on ntp service

chkconfig ntpd on
service ntpd start

* For more sophisticated uses, please see this post.

Sync Time using Linux Desktop

Issues

NTP socket is in use

* Error message:

the NTP socket is in use, exiting

* Cause:
– NTP server is running.
* Fix:
– Stop NTP server

# check ntpd process
ps -ef | grep ntpd
 
# Stop ntpd if started
service ntpd stop
 
# ntpd process should be gone
ps -ef | grep ntpd
 
# kill if needed
killall ntpd
 
# now update time manually
ntpdate pool.ntp.org
 
# turn on ntpd service
chkconfig ntpd on
service ntpd start
This entry was posted in Linux and tagged , , , . Bookmark the permalink.

Leave a Reply

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.