Linux Mint

How to configure NTP on Linux Mint

NTP, also known as Network Time Protocol, is one of the most reliable methods for synchronizing internal clock timings on systems in a network, as its name implies. After that, you don’t need to manually check and set your time if your system supports NTP. The operating system is in charge of time zone management, whereas NTP is in charge of synchronizing the Coordinated Universal Time (UTC).

A fraction of a time difference might trigger various problems for your system. When it comes to tracking security-related concerns, having perfectly synched time is critical; troubleshooting can be tough if the timestamps in log files are inaccurate and even in financial services, reliable timekeeping is essential. Troubleshooting issues, performance monitoring, network acceleration, and network management systems all rely on the accuracy of timestamps. So you can save yourself from such problems if you have properly configured NTP on your operating system.

How to install NTP on Linux Mint

So the first step is to install the Network Time Protocol to utilize its functionality by typing:

$ sudo apt install ntp

After that you need to verify if the NTP services are now active or not by typing:

$ timedatectl

As you can see currently, the NTP service is not available although you have already installed it. So there are multiple ways to activate this service and for that, you can type.

$ sudo timedatectl set-ntp true

It can be seen that after running the command it is still showing an error that “NTP not supported”. Now what you can do in such a situation is to run start and enable commands that can solve this issue and activate the NTP services:

$ sudo systemctl start ntp
$ sudo systemctl enable ntp

After enabling the NTP services the next step is to restart the services so that these new settings can be worked:

$ sudo systemctl restart ntp

There is a high chance that you are able to solve this problem after using this command, you can verify it by typing.

$ timedatectl

How to allow NTP through firewall

After installing and activating the NTP services, the next step is to allow it through the firewall so that it can synchronize the network on all the servers. But, before that you need to make sure that the firewall is currently active in your OS or not by typing:

$ sudo ufw status verbose

The firewall is currently inactive, so you can activate it by typing:

$ sudo ufw enable

Now you need to allow the NTP services on the firewall so that the communication can be established between the client and server by typing.

$ sudo ufw allow ntp

To implement the newly made changes, you need to restart the firewall settings:

$ sudo ufw reload

Later you can check the status of the firewall and the NTP by typing:

$ sudo ufw status
$ systemctl status ntp

How to check NTP stats in Linux Mint

Now to check if your NTP services are synchronized with the server or not and you can do that by installing the NTP stat utility:

$ sudo apt install ntpstat

After its installation, you can verify the NTP synchronization by typing:

$ ntpstat

How to configure NTP server on Linux Mint

To set up an NTP server you need to make some changes to the NTP configuration which is available on “/etc/ntp.conf ” file and you can do that by using any editor:

$ sudo nano /etc/ntp.conf

Now, the next step is to choose the pool server that you want to synchronize with your NTP server by visiting their official website. After that, you need to select a server pool from which you need to synchronize your time, as in our case we have selected the pool from the United Kingdom.

After that you need to copy the UK pool zone and then paste those in the ntp.conf file that you have already opened:

Now you need to restart the NTP to implement the newly made settings by typing again:

$ sudo systemctl restart ntp

After that you need to check the status of NTP if everything is working fine or not by typing:

$ systemctl status ntp

Conclusion

Network time protocol is a very essential utility if you want to synchronize your clock with the outside world. Monitoring security-related concerns necessitate exact time alignment; similarly, troubleshooting might be difficult if log file timestamps are inaccurate. In this article, we have discussed what problems you can face while configuring the NTP, and how you can solve those problems in Linux Mint distribution.

About the author

Taimoor Mohsin

Hi there! I'm an avid writer who loves to help others in finding solutions by writing high-quality content about technology and gaming. In my spare time, I enjoy reading books and watching movies.