Thursday, 20 June 2013

Setting Up NTP Server on Manjaro

Create a text file containing the following....
#!/bin/bash
systemctl stop ntpd.service
ntpd -qg
ntpd -qg
ntpd -qg
ntpd -qg
systemctl start ntpd.service
hwclock -w
... and name file ntp.sh and make executable.

Edit /etc/ntp.conf and under '# Associate to public NTP pool servers; see http://www.pool.ntp.org/', replace the three lines of 'server 0.pool.ntp.org' with...
server 0.uk.pool.ntp.org
server 1.uk.pool.ntp.org
server 2.uk pool.ntp.org
server 3.uk pool.ntp.org
N.B. The 'uk' is for United Kingdom. Insert your own region.

Save, and as sudo, run ntp.sh script.
sudo ./ntp.sh
To sync the clock every time your computer boots run...
sudo systemctl enable ntpd 
N.B. Alternately, replace 'systemctl start ntpd.service' in the top script with the above command.

No comments:

Post a Comment