How To Synchronize System Time In Linux? – POFTUT

How To Synchronize System Time In Linux?

Time is important for systems because all work done according to time and logs get their timestamps. Normally server hardware provides time but it can be false over time because the hardware clock is not precise. Ntp is a protocol designed to get time info from the network. NTP can also provide date and time information to other servers as a daemon. NTP full name is Network Time Protocol.

Install Ntpdate

Ntpdate is simple and fast ntp client used to get information about time.

CentOS, Fedora, Red Hat

Ubuntu, Debian, Mint, Kali

Get Time From Ntp Server

We can use ntpdate client to get the current time from the NTP server. We will specify the NTP server as a parameter to the ntpdate command.

We need root privileges to use ntpdate to sync clock

Check Current Time From Local Server

We can list current time in the server by using date command.

Enable Firewall For Ntp Related Ports

We may need to open ports about NTP like below by using iptables

Get Current Time Info

ntpdate is an old tool and deprecated we can use datetimectl according to ntpdate

LEARN MORE  How To Change Cisco IOS Time?

Get Current Time Info

Get Current Time Info

We see that our time is synchronized with ntp with “NTP synchronized” line.

How To Synchronize System Time In Linux? Infographic

How To Synchronize System Time In Linux? Infographic

How To Synchronize System Time In Linux? Infographic

 

Leave a Reply

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

Enjoy this blog? Please spread the word :)