0

Assume ntpd reads the following configuration when started:

keys /etc/ntp.keys
trustedkey 1 2 3
requestkey 2

server <server1_IP> key 1
server <server2_IP>

As describd in the ntpq documentation, its possible to send configuration commands to the server as run-time configuration commands in the same format as the configuration file, using :config [...].

The sent commands will be added to the run-time configuration, therefore if I want to add a new server, I run ntpq -c ":config server <server3_IP>". If I want to remove an association, ntpq -c ":config unpeer <server2_IP>".

How can I

  • change configurations? E.g. Key identified by keyID 3 is not trusted anymore and have to be removed from trustedkeys
  • remove existing configurations? E.g. how do I remove the requestkey ?

I need those functionalities because I have to be able to reconfigure ntpd at runtime without restarting it.

claudiu
  • 75
  • 1
  • 7

1 Answers1

0

You can remove configs with ntpq -c "keyid <your_keyid>" -c "passwd <your_md5_password" -c ":unconfig <server_IP>"

For changing I'm not sure, but removing and adding should work.

Though it's supported by ntpq, it's not advised to use this functionality according to comp.protocols.time.ntp.

  • The `:unconfig` command is not documented in the ntpq documentation and it is not appearing in the ntpq interactive mode list of commands. Does it work for all kind of configurations (e.g. removing the `requestkey`)? – claudiu Jul 06 '17 at 16:02