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.

[root@techlanda.com ~]# yum install ntp ntpdate ntp-doc 

Press y to install

Turn on service, enter

[root@techlanda.com ~]# chkconfig ntpd on (Start the service automatically during the system restart)

[root@techlanda.com ~]# service ntpd status

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

[root@techlanda.com ~]# service ntpd stop

Step 2: 

Add your DNS IP or FQDN 

[root@techlanda.com ~]# vi  /etc/ntp.conf

Add your dns server at the end of the line:

#statistics clockstats cryptostats loopstats peerstats
server 192.168.1.10
server 192.168.1.100

[root@techlanda.com ~]# service ntpd start

 Apply the below command for ntp timesync.

[root@techlanda.com ~]#ntpdate -u 192.168.1.10
[root@techlanda.com ~]#ntpdate -u 192.168.1.100

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

[root@techlanda.com ~]#service ntpd restart

Hardware Clock Sync

[root@techlanda.com ~]#hwclock --systohc

Step 3:

Output


[root@techlanda.com ~]#date
Wed Feb 10 00:20:33 IST 2016


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

Share: