Technology and troubleshooting.

Tuesday, February 9, 2016

Synchronize NTP Time in Linux with Windows sever in Centos

Configure NTP to Synchronize the system clock in CentOS Linux with Windows sever.

Easy installation NTP (Network Time Protocol) by using yum command CentOS based operating system.
Synchronize NTP Time in Linux
Step 1:

You need to install the following packages:

ntp : ntpd server which continuously adjusts system time and utilities used to query and configure the ntpd daemon.
ntpdate : Utility to set the date and time via NTP.
ntp-doc : NTP documentation

Procedure to install NTPD on CentOS

Open the terminal or login over the ssh session. You must login as the root user. Type the following command to install ntpd.

[ ~]# yum install ntp ntpdate ntp-doc 

Press y to install

Turn on service, enter

[ ~]# chkconfig ntpd on (Start the service automatically during the system restart)

[ ~]# service ntpd status

If it's running stop the ntpd service by using the below command.

[ ~]# service ntpd stop

Step 2: 

Add your DNS IP or FQDN 

[ ~]# vi  /etc/ntp.conf

Add your dns server at the end of the line:

#statistics clockstats cryptostats loopstats peerstats

[ ~]# service ntpd start

 Apply the below command for ntp timesync.

[ ~]#ntpdate -u
[ ~]#ntpdate -u

After updating the DNS you need to restart the ntpd service to apply changes.

[ ~]#service ntpd restart

Hardware Clock Sync

[ ~]#hwclock --systohc

Step 3:


[ ~]#date
Wed Feb 10 00:20:33 IST 2016

I hope this information is useful for you. Please forgive any typos or incomplete sentences.