Tuesday 23 October 2012

How to set up ntp

Ubuntu how to set up ntp?


First of all update all your repositories:

apt-get update

Next run the following command

sudo dpkg-reconfigure tzdata

 Choose you location:

NTP server setting up the location - country

NTP server setting up your city

As a confirmation you should get the following information:

Current default time zone: 'Australia/Sydney'
Local time is now:      Fri Oct 19 11:30:48 EST 2012.
Universal Time is now:  Fri Oct 19 00:30:48 UTC 2012.


Next step is to update the address of ntp server. In this case we will use ubuntu ntp server. Open ntpdate file:

sudo vim /etc/cron.daily/ntpdate

and put this line into the file:

ntpdate ntp.ubuntu.com

The last step is to change permissions on the ntpdate file so that they can be read by the system to every user:

sudo chmod 755 /etc/cron.daily/ntpdate

Now you can check in the time is set properly on your ubuntu. Run this command:

date

And that is it!



No comments:

Post a Comment