How to set System Time using NTP?

Posted by Joys of Programming on in Linux, Ubuntu

NTP is helpful to synchronize system time of computer over a network. This is very useful if you have multiple computers and you require all the computers to have uniform time. You can start the NTP server in one of the machines and synchronize the time across all the machines using this server. This is useful to set the time of your machine accurately.

Take for example, you want to synchronize your machine using a server “server_name”

Start the NTP protocol in the server “server_name”

If you  want to accurately synchronize your machine to your Timezone, you can choose any of the continent pools (here Asia is chosen)


$ sudo ntpdate asia.pool.ntp.org

or


$ sudo ntpdate europe.pool.ntp.org

Note that you must have sudo access to run the command else you will get the following error


$ ntpdate europe.pool.ntp.org
 9 Feb 22:12:22 ntpdate[21006]: bind() fails: Permission denied

This is because NTP runs on special ports 123 (All ports between 0 and 1024 are special ports and require sudo access to create sockets)

Tags: , , , , ,

Comments:

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2009-2012 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.