≡ Menu

How to synchronize date and time on Linux using NTP?

The NTPD or network time protocol daemon can be used to automatically synchronize date and time from a central time server.

NTPD can be installed using yum on CentOS, Fedora or Red Hat:

yum install ntp

On Debian or Ubuntu, you can use the apt-get command:

apt-get install ntp

Now that you have installed NTP, you can make ntpd run on startup:

chkconfig ntpd on

To update your time and date now, use the following command:

ntpdate pool.ntp.org

The above command will synchronize your date and time from the central time server pool.ntp.org.

To check your current date and time:

[root@server ~]# date
Mon Sep 23 14:15:53 MSD 2013
[root@server ~]# cal
   September 2013
Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

{ 0 comments… add one }

Leave a Comment