Sync Time with Public NTP Servers Using ntpd command – Linux

In this article we are going to show how to update server time to sync internet time with NTP.  Sync time Or Server time with NTP sync is important which creates a lot problem if any time mismatch. Examples Like, We will get wrong time in server logs, If server is part cluster then cluster services will fail to serve the services due to time mismatch.

Check ntpd service status and stop followed by below commands

Sync Time with Public NTP Servers Using ntpd command

[root@linux ~]# /etc/init.d/ntpd stop
ntpd is stopped
[root@linux ~]#

update the time 

[root@linux ~]# ntpd -gq
ntpd: time set -106.807803s

[root@linux ~]#
  • -q –-> requests the daemon to quit after updating the date from the ntp server.
  • -g –-> update irrespective of the time offset

Now restart the ntpd service

[root@linux ~]# /etc/init.d/ntpd restart
Shutting down ntpd:                                        [  OK  ]
Starting ntpd:                                             [  OK  ]

[root@linux ~]#

Check the time on the server and verify with internet time.

[root@linux ~]# date

Successfully updated. That’s it.

Install and configure Time Server RHEL 7

Monitor Time Sync in between NTP Server and Client using Nagios

For Video Tutorials

Thanks for Your Wonderful Support and Encouragement

More than 40,000 techies are part of our ARKIT community. Join us today and keep learning Linux, Cloud, Storage, DevOps, and IT technologies.

Get Email Updates Download E-Books Facebook Page YouTube Channel Twitter Join Telegram Group Join WhatsApp Group
author avatar
Ravi Kumar Ankam
My name is Ravi Ankam. I am passionate about learning new technologies quickly and sharing knowledge with others. My goal is to help learners grow their skills, because the more you learn, the more you earn. See About Me
blank

Ravi Kumar Ankam

My name is Ravi Ankam. I am passionate about learning new technologies quickly and sharing knowledge with others. My goal is to help learners grow their skills, because the more you learn, the more you earn. See About Me

Leave a Reply

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