Set up Time Synchronization on AlmaLinux 9

In this guide, we want to teach you How To Set up Time Synchronization on AlmaLinux 9.

Computer time synchronization is the process of ensuring that the system clocks of computers are coordinated. The real-time clocks of computers are as susceptible to drift as any other timepiece.

However, protocols have been devised primarily to maintain the coordination of time of networked computers. Network Time Protocol (NTP) and Precision Time Protocol (PTP) are dedicated to coordinating system time.

The protocols distribute time stamps between one or more master clocks and time clients.

How To Set Up Time Synchronization on AlmaLinux 9

To set up time synchronization, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide the Initial Server Setup with AlmaLinux 9.

Now follow the steps below to complete this guide.

Check Time Zone And Clock on AlmaLinux 9

The most basic command to find out the time on your server is “date”. Any user can run the following command to check the date and time on AlmaLinux 9:

sudo date
Output
Tue Jan  3 09:29:40 AM EDT 2023

Note: Most often your server will default to the UTC time zone. UTC is Coordinated Universal Time, the time at zero degrees longitude. Also, using Universal Time reduces confusion when your infrastructure spans multiple time zones.

Change Time Zone

If you have requirements and need to change the time zone on AlmaLinux 9, you can use the “timedatectl” command.

First, list the available time zones on AlmaLinux 9 with the following command:

sudo timedatectl list-timezones

Your output will show a list of available time zones on AlmaLinux 9.

When you find the correct time zone, use the following command to set the time zone:

sudo timedatectl set-timezone America/New_York

Remember to replace the time zone you have seen in the list.

At this point, you know how to check the time zone and clock on AlmaLinux 9, let’s install and start NTP.

Install NTP on AlmaLinux 9

To install NTP on your server, you need to have Chrony installed on your server.

Chrony is an implementation of the Network Time Protocol and is useful in a number of ways.

sudo dnf install chrony -y

At this point, start and enable your Chrony service with the commands below:

# sudo systemctl start chronyd 
# sudo systemctl enable chronyd

At this point, verify that your Chrony service is active and running on your server, run the command below:

sudo systemctl status chronyd
Output
● chronyd.service - NTP client/server
     Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor p>
     Active: active (running) since Mon 2023-01-02 05:34:54 EST; 1 day 3h ago
       Docs: man:chronyd(8)
             man:chrony.conf(5)
   Main PID: 47827 (chronyd)
      Tasks: 1 (limit: 23609)
     Memory: 968.0K
        CPU: 889ms
     CGroup: /system.slice/chronyd.service
...

If everything went well then Your date and time should be synchronized from the NTP Server on AlmaLinux 9. You can verify your timezone with the following command:

timedatectl
Output
 Local time: Tue 2023-01-03 09:35:07 EST
           Universal time: Tue 2023-01-03 14:35:07 UTC
                 RTC time: Tue 2023-01-03 14:35:07
                Time zone: America/New_York 
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

NTP synchronized: yes” means that the time on AlmaLinux 9 has been successfully synced, and the “NTP enabled: yes” means that the timesyncd is enabled and running.

Also, you can visit this guide on Install and Configure NTP Server and Client on AlmaLinux 9, to set up the NTP server and client.

Conclusion

At this point, you have learned to view the system time, change time zones, and sync your time.

Hope you enjoy it.

Also, you may be like these guides:

Install OpenVPN on AlmaLinux 9

How To Install Ntopng on AlmaLinux 9

How To Install Yarn on AlmaLinux 9

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *

Stay informed and not overwhelmed, subscribe now!