How to sync with NTP servers

Published by Subhas Fagu on 09/05/09 12:08:06
Last edited on 09/05/09 12:08:06

NTP is the Network Time Protocol. It is a standard way to keep system clocks synced. This post will go through the easy steps of getting you linux box configured to always follow the correct time based on NTP servers.

First you will need to install ntp

sudo apt-get update
sudo apt-get install ntp

Always make a backup of config files

sudo mv /etc/ntp.conf /etc/ntp.conf-bak
sudo nano /etc/ntp.conf 

Now you just need to set the servers you want to sync with

# ntpd.conf
tinker panic 0
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org

Restart and update

sudo /etc/init.d/ntp stop
sudo ntpdate pool.ntp.org
sudo /etc/init.d/ntp start
ntpq -pn

And you done!, the last command will show how much in sync you are with the listed ntp servers.

About the Author

Subhas Fagu is an energetic person who you will never catch doing the same thing twice…unless it’s working. He’s always engaged in new concepts, frameworks, operating systems, applications, you name it and you’ve got a conversation. Being a founder of Techlicity Ventures, he's been a key in the business and technical development of all previous and upcoming projects. Subhas contributes a wide variety of perspectives to all projects to ensure risk coverage and smooth deployment.

Bookmark and Share
Blog Widget by LinkWithin
blog comments powered by Disqus

Valid XHTML 1.0!