ntpd listens on numerous interfaces by default, I only want it to listen on 127.0.0.1:123 since I only want the localhost to sync the time.
How to do that, I tried by editing /etc/default/ntp on Debian Wheezy:
NTPD_OPTS='-4 -I 127.0.0.1'
But it still listens globally on 0.0.0.0:123
Any ideas?
Remove all
-I
or--interface
options from/etc/default/ntp
and insert the following into your/etc/ntp.conf
:An excerpt from the
ntpd(1)
manual page about the-i
option:See also the Debian manual page (I could not find it in Arch Linux one) of
ntp.conf(5)
.With ntp listening only on 127.0.0.1, it looks like it can't initiate connection to a public ntp server :
It must be bind to a routable ip address to work.
Full /etc/ntp.conf that protocol neutral (IPv4 &| IPv6)
If you want to reduce the number of listening services for security reasons, openntpd might be considered, as it does not require a listen server to act as a client. It is considered slightly less accurate than ntpd; it is reliable within a few hundred ms, but this is suitable for most purposes.