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
Step-2 : Set your Time Zone from different timezone
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:
- Sync time using chronyd (Suitable for virtual system)
- Sync time using ntpd (Suitable for networking system)
1. Sync time using chronyd
Install the chronyd package
Start the chronyd services
Edit the configuration file
Add these lines
For CentOS
For RHEL
After adding these lines simply save and exit.
Restart the services to make changes in effect.
Enable this services to run at every boot.
2. Sync time using ntpd
Install the ntpd package
Start the ntpd services
Edit the configuration file
Add these lines
For CentOS
For RHEL
After adding these lines simply save and exit.
Restart the services to make changes in effect.
Enable this services to run at every boot.
Congratulations, now you have enabled the time synchronization and you are able to run different time zones on same system.