Configure NTP server using Chrony on RHEL 8
- Install Chrony (if not already installed):
You can install Chrony using the package manager dnf. Run the following command in your terminal:
#sudo dnf install chrony
2. Edit the Chrony Configuration File:
Open the Chrony configuration file /etc/chrony.conf in a text editor with root privileges. You can use nano, vim, or any other editor you prefer.
#sudo vim /etc/chrony.conf
3. Configure NTP Servers:
In the chrony.conf file, you’ll find a section where you can specify NTP servers. Locate the server directive and add your NTP server(s) to it. You can comment out existing servers or add new ones. For example: Replace ntp.example.com with the address of the NTP server you want to use.
server time.nplindia.org iburst
4. Restart Chrony:
After making changes to the configuration file, restart the Chrony service to apply the changes:
#sudo systemctl restart chronyd
5. Verify Configuration:
You can verify that Chrony is synchronizing with the new NTP server(s) by checking its status:
#chronyc sources -v
This command will display information about the currently configured NTP sources and their synchronization status.
That’s it! You have now set a new NTP server using Chrony on RHEL 8. Make sure to choose reliable NTP servers for accurate time synchronization.