How To Synchronize System Time In Linux?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/synchronize-system-time-linux/
PINTEREST
PINTEREST
INSTAGRAM

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 network. Ntp can also provide 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

Ubuntu, Debian

Get Time From Ntp Server

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

We need root privileges to use ntpdate to sync clock

Check Current Time From Local Server

We can list current time in 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  Php - Install Php In Linux and Create Development Environment

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

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/synchronize-system-time-linux/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.