![]() |
VOOZH | about |
We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.
Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.
Follow TNS on your favorite social media networks.
Become a TNS follower on LinkedIn.
Check out the latest featured and trending stories while you wait for your first TNS newsletter.
timedatectl command, which is installed on most Linux servers by default. Before you do this, you’ll want to know which timezone you should set. To view a listing of all timezones, issue the command:
timedatectl list-timezonesScroll through that listing until you find the correct one for your area. For example, if you live in Louisville, Ky., the proper time zone is America/Kentucky/Louisville and is set like this:
sudo timedatectl set-timezone America/Kentucky/LouisvilleOnce you’ve done that, you can verify the change with:
timedatectlMake sure you do the above on all of your servers (be they on bare metal, virtual machines or containers). You’re now ready for Chrony.
sudo apt-get install chrony -yIf you’re on a Fedora-based distribution, the command is:
sudo dnf install chrony -yFor Arch-based distributions:
sudo pacman -S chronyOnce Chrony is installed, make sure to start and enable it with the command:
sudo systemctl enable --now chronyd
sudo timedatectl set-ntp yesYou’ll receive no output from the above command. With that taken care of, check the time with:
timedatectlIt should be spot on. Not only that, but you should also now see that the NTP service is listed as active, which means Chrony is keeping your time in check. Do note that if you had to change the timezone of your machine, you should reboot so the changes take effect.
sudo nano /etc/chrony.confIf you find the file isn’t there, try the command:
sudo nano /etc/chrony/chrony.confAt the top of the file, you’ll find a single public server listed that is used to keep time in sync. On my AlmaLinux test server, that line is:
pool 2.almalinux.pool.ntp.org iburstIf you want, you can always change the default pool. For example, according to the NTP Pool Project, you could use the following pools for the United States: server 0.us.pool.ntp.org server 1.us.pool.ntp.org server 2.us.pool.ntp.org server 3.us.pool.ntp.org There are several other options you can look through but you’ll most likely want to keep them as is. You can also configure your Linux machine as a Chrony NTP server. For this, you must uncomment (remove the leading # character) the following lines in the Chrony configuration file:
allow 192.168.0.0/16 local stratum 10
sudo systemctl restart chronydMake sure to allow the NTP service through your firewall. For example, on AlmaLinux that would require the following two commands:
sudo firewall-cmd --add-service=ntp –permanent sudo firewall-cmd --reloadYou could then configure your NTP server within the chrony.conf files of the clients on your network. For example, if your NTP server is at 192.168.1.210, you could add the following in the Chrony config file:
pool 192.168.1.210 iburst maxsources 4At this point, your client will remain in sync with your server. As long as your server is in sync with the NTP pool, any server (or desktop) that uses it as a time server will remain in sync. Avoid time-related issues with this simple-to-use tool, and you’ll pull less hair and lose less sleep.