Connect with us

Hi, what are you looking for?

Linux

How to Sync Time with Timezone on CentOS 7

How to Synchronize Time and Timezone on CentOS 7 / RHEL 7 / SL 7 / OL 7. Time synchronization is the most vital part of any Linux distros. The configuration of time sync is straight forward using NTP (Network Time Protocol). It includes some couple of commands that works fine with the time synchronization. Keeping different clocks running into a same severs is a quite interesting task to keep running your system time up to date. When any user login to your system so it is so important task to note the user login time according to the local time of that system time zone. Most of the services are running in different time zones so it is vital need to run the system with accurate time.

Step-1 : Check the different available time zones
$ sudo timedatectl list-timezones
Step-2 : Set your Time Zone from different timezone
$ sudo timedatectl Asia/Kolkata
Step-3 : Sync time using NTP daemons

There are two types of NTP daemons including chronyd and ntpd. You should select and use only one to avoid running two NTP daemons at a same time on same machine this cause ntp incompatibility and instability using two NTP daemons at same time.
This tutorial includes two NTP daemons you should select any one:

  1. Sync time using chronyd (Suitable for virtual system)
  2. Sync time using ntpd (Suitable for networking system)
1. Sync time using chronyd

Install the chronyd package

$ sudo yum install chrony

Start the chronyd services

$ sudo systemctl start chrnoyd

Edit the configuration file

$ sudo vi /etc/chrony.conf

Add these lines
For CentOS

Advertisement. Scroll to continue reading.
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

For RHEL

server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst

After adding these lines simply save and exit.
Restart the services to make changes in effect.

$ sudo systemctl restart chrnoyd

Enable this services to run at every boot.

$ sudo systemctl enable chrnoyd
OR
2. Sync time using ntpd

Install the ntpd package

$ sudo yum install ntp

Start the ntpd services

Advertisement. Scroll to continue reading.
$ sudo systemctl start ntpd

Edit the configuration file

$ sudo vi /etc/ntp.conf

Add these lines
For CentOS

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

For RHEL

server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst

After adding these lines simply save and exit.
Restart the services to make changes in effect.

$ sudo systemctl restart ntpd

Enable this services to run at every boot.

Advertisement. Scroll to continue reading.
$ sudo systemctl enable ntpd

Congratulations, now you have enabled the time synchronization and you are able to run different time zones on same system.

Comments
Advertisement
Advertisement

Linux

In this tutorial we will configure ISCSI Target Server on CentOS 8 / RHEL 8. ISCSI stands for Internet Small Computer Systems Interface.  This...

Linux

In this tutorial we will configure SELinux Modes on CentOS 8 / RHEL 8. SELinux stands for Security-Enhanced Linux and it is developed by...

Linux

DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create...

Linux

If you forget a root password of your RHEL 8 and CentOS 8 and want to reset the password so that the RHEL 8...

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Advertisement

You May Also Like

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Windows

Internet is the most important public network for connecting to the WEB. For internet connection requirement the ISP is required as well as it...

Windows

How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...

Windows

How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...