|
Ntp server and Client(s) on Ubuntu/Debian Step 1: Update repository indexBog'liq NTP serverStep 5: Restart the NTP server
In order for the above changes to take effect, you need to restart the NTP
server. Run the following command as sudo in order to do so:
$ sudo service ntp restart
Step 6: Verify that the NTP Server is running
Now, check the status of the NTP service through the following command:
$ sudo service ntp status
Configure NTP Client to be Time Synced with
the NTP Server
Let us now configure our Ubuntu client machine to be time-synchronized with
the NTP server.
Step 1: Install ntpdate
The ntpdate command will let you manually check your connection
configuration with the NTP-server. Open the Terminal application on the client
machine and enter the following command as sudo:
$ sudo apt-get install ntpdate
Step 2: Specify IP and hostname of the NTP server in the
hosts file
For your NTP server to be resolved by a hostname in your client machine, you
need to configure your /etc/hosts file.
Open the hosts file as sudo in the nano editor by entering the following
command:
$ sudo nano /etc/hosts
Step 3: Check if the client machine’s time is synchronized
with NTP server
The following ntpdate command will let you manually check if time is
synchronized between the client and server systems:
$ sudo ntpdate NTP-server-host
The output should ideally show a time offset between the two systems.
Step 4: Disable the systemd timesyncd service on the client
Because we want our client to sync time with the NTP server, let us disable the
timesyncd service on the client machine.
Enter the following command to do so:
$ sudo timedatectl set-ntp off
Step 5: Install NTP on your client
Run the following command as sudo in order to install NTP on your client
machine:
$ sudo apt-get install ntp
|
| |