Red Hat Certified System Administrator RHCSA · Free Practice Question Medium
Question 2
On ServerB, configure NTP synchronization using the Chrony service to ensure accurate timekeeping. Verify that the Chrony service is running and that NTP synchronization is active.
-
A
Pass
-
B
Fail
Reveal correct answer
Correct answer: A
Explanation
Answer:
To configure and verify NTP synchronization on ServerB, follow these steps:
Step-by-Step Solution
Check the Current System Time and Time Zone Settings:
- # timedatectl
Explanation: The
timedatectlcommand shows the current system time, time zone, and NTP synchronization status. This is useful to confirm the current configuration before making changes.
Install the Chrony Package:
- # dnf install chrony -y
Explanation: Chrony is the default NTP service on many modern Linux distributions, preferred for its efficiency in handling network time synchronization. This command installs the Chrony package, which includes the
chronyddaemon.
Enable and Start the Chrony Service:
- # systemctl enable --now chronyd
Explanation: This command enables
chronydto start on boot and starts the service immediately. Chrony will begin syncing time with the NTP servers configured in/etc/chrony.conf.
Verify that the Chrony Service is Running:
- # systemctl status chronyd
Explanation: Displays the status of the
chronydservice. Look for “active (running)” in the output, which confirms that the service is functioning correctly.
Review the Chrony Configuration:
- # cat /etc/chrony.conf
Explanation: Displays the contents of the Chrony configuration file, typically located at
/etc/chrony.conf. This file specifies the NTP servers used for time synchronization, which are often set to public pools by default. Adjust these as necessary for local or organizational NTP servers.
Enable NTP Synchronization:
- # timedatectl set-ntp true
Explanation: This command enables NTP synchronization, allowing the system clock to be synchronized with the NTP servers defined by Chrony. It is particularly useful if NTP sync is not already enabled.
Note: NTP (Network Time Protocol) ensures the system time is consistent and accurate by syncing with remote time servers. Accurate timekeeping is essential for logging, security, debugging, and authentication processes on a Linux system.
Verify NTP Synchronization Status:
- # timedatectl
Explanation: Run
timedatectlagain to confirm that NTP synchronization is enabled. The output should show “NTP synchronized: yes” and the system clock set to the current time.
Additional Notes for Learners:
Why Use Chrony:
Chrony is preferred over older NTP implementations for its ability to quickly synchronize time on systems with irregular network connections or virtualized environments. It’s also more accurate and efficient for systems with intermittent or limited connectivity.
Key Configuration Options in
/etc/chrony.conf:You can adjust the list of NTP servers by modifying or adding
poolorserverentries. This is useful if you need to sync with a specific organizational or local NTP server.
Troubleshooting:
Chrony Service Issues: If
chronyddoesn’t start, check for typos in the/etc/chrony.conffile and ensure there are no conflicting services (such asntpd).Time Sync Not Reflecting: Run
timedatectlto verify that NTP is enabled and active. If not, re-runtimedatectl set-ntp true.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
