Configure NTP on Linux: Step-by-Step Guide
To configure the NTP service on a Linux system, you can follow these steps:
- Install the NTP software package: Use a package management tool to install the NTP software package. For example, on an Ubuntu system, you can use the following command to install NTP:
sudo apt-get install ntp
On CentOS systems, you can install NTP using the following command:
sudo yum install ntp
- The configuration file for the NTP (Network Time Protocol) service is located at /etc/ntp.conf.
server ntp.example.com
- Start the NTP service: Activate the NTP service and set it to start automatically with the system. On Ubuntu systems, you can start the NTP service using the following command:
sudo systemctl start ntp
sudo systemctl enable ntp
On CentOS system, you can start the NTP service using the following command:
sudo systemctl start ntpd
sudo systemctl enable ntpd
- Network Time Protocol Query
ntpq -p
These are the basic steps to configure NTP service on a Linux system. Depending on your specific needs and system configuration, further configuration may be necessary.