I wanted to match the times between two systems on an isolated network running Ubuntu 22. This can be done using chrony (https://chrony.tuxfamily.org) on the two systems - one system serves as the local time server to the other client system.
Setting up the Server
- Optional. If chrony is not installed, run the following command in the Terminal to install it.
$ sudo apt install chrony - Using a text editor, add the following lines to the file /etc/chrony/chrony.conf.
local stratum 8
allow xxx.xxx.xxx.xxx
Note 1: The keyword local tells chrony to server isolated networks.
Note 2: The allow keyword specifies the IP address of the client to server - Restart the chrony service using the following command. Or you can reboot.
$ sudo systemctl restart chronyd
Setting up the Client
- Optional. If chrony is not installed, run the following command in the Terminal to install it.
$ sudo apt install chrony - Using a text editor, add the following to the file /etc/chrony/chrony.conf.
server yyy.yyy.yyy.yyy minpoll 0 maxpoll 5 maxdelay 0.1 - Restart the chrony service using the following command. Or reboot.
$ sudo systemctl restart chronyd - To verify whether the syncing is working, the following command can be used.
$ chronyc sources -v
Note: If the sync is successful, the MS column should be showing the symbols ^* for the IP address of the server entry.