Lab 25: Configure Time Services
Objective Focus
- Deploy, configure, and maintain systems
- Configure time service clients
Official RHCSA EX200 Exam Objectives
What is meant by time services?
In order understand to time services, we have to explain what NTP, or Network Time Protocol, is first. NTP is a networking protocol that that is used over the wire to synchronize the system clocks of computers with a remote source. NTP uses UDP port 123.
Even now, your computer is communicating with a time source to get an accurate clock. A time source can be on local network, over the internet, and radio clock. We mostly see devices connected to time sources over the internet. I recommend looking up atomic clocks, stratum levels and checking out https://ntp.org.
How does NTP work in RHEL?
In RHEL, NTP is handled by Chrony under Chronyd.service.
- Run the above command to check that chronyd is running.
- What time source is being used?
What file is used to manage the chrony service?
In the chrony.conf file, important directives, or keywords, are the pool and server. The pool keyword points to a group or “pool” of servers. Chronyd binds itself to one of the servers and if one fails it will switch over automatically. The server directive lets you use a hostname or IP address of a single server.
Working with Chronyd
- chronyc is a tool to help manage chronyd
First lets check the status
Make sure it is started, not already
Make sure it pertists after a reboot
Making a change
Lets edit chrony.conf
- add time.google.com and comment out pool line
Restart the service
More on Chronyc
Using chronyc, we’ll check if the new source is picked up
Additionally, we can see clock stats
Addtional commands for managing time
- print or set the system date and time
- Example in the man page setting the time to February 29, 2004 at 4 PM
- This change does not persist.
- Great for scripting.
- timedatectl - Control the system time and date
- Running the command without options will output a summary of the time settings.
- Reboot and see if it persists!
Thats all for Time related services! And Check your that your firewall configuration is allowing port 123!!