How to enable NTP in timedatectl in rhel 7 onwards ?
Today we will see how to enable NTP in RHEL 7 onwards.
Lets see it step by step.
1. Check current timezone and date
[root@ngelinux samba]# date Thu Mar 7 22:18:49 IST 2024 [root@ngelinux samba]# [root@ngelinux samba]# timedatectl Local time: Thu 2024-03-07 22:19:22 IST Universal time: Thu 2024-03-07 16:49:22 UTC RTC time: Thu 2024-03-07 22:19:13 Time zone: Asia/Kolkata (IST, +0530) NTP enabled: no NTP synchronized: no RTC in local TZ: yes DST active: n/a Warning: The system is configured to read the RTC time in the local time zone. This mode can not be fully supported. It will create various problems with time zone changes and daylight saving time adjustments. The RTC time is never updated, it relies on external facilities to maintain it. If at all possible, use RTC in UTC by calling 'timedatectl set-local-rtc 0'. [root@ngelinux samba]#
2. Set NTP to true
[root@ngelinux samba]# timedatectl set-ntp true [root@ngelinux samba]# timedatectl Local time: Thu 2024-03-07 16:49:58 IST Universal time: Thu 2024-03-07 11:19:58 UTC RTC time: Thu 2024-03-07 22:20:15 Time zone: Asia/Kolkata (IST, +0530) NTP enabled: yes NTP synchronized: no RTC in local TZ: yes DST active: n/a Warning: The system is configured to read the RTC time in the local time zone. This mode can not be fully supported. It will create various problems with time zone changes and daylight saving time adjustments. The RTC time is never updated, it relies on external facilities to maintain it. If at all possible, use RTC in UTC by calling 'timedatectl set-local-rtc 0'. [root@ngelinux samba]# date Thu Mar 7 16:50:02 IST 2024 [root@ngelinux samba]#
