如何禁用ntpd?
我正在VM中运行Ubuntu。 如何禁用ntpd?
要停止ntpd:
sudo /etc/init.d/ntp stop
要么
sudo service ntp stop
为了防止它在启动时启动:
sudo update-rc.d -f ntp remove
如果已安装,请卸载ntpd。 您仍将安装ntpdate。 (很难删除。)通过在/etc/default/ntpdate
添加exit 0
来阻止它执行。
使用systemd,这两个命令是:
sudo systemctl stop ntp sudo systemctl disable ntp
输出(我认为警告可以忽略)
ntp.service is not a native service, redirecting to systemd-sysv-install Executing /lib/systemd/systemd-sysv-install disable ntp insserv: warning: current start runlevel(s) (empty) of script `ntp' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (1 2 3 4 5) of script `ntp' overrides LSB defaults (1). insserv: warning: current start runlevel(s) (empty) of script `ntp' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (1 2 3 4 5) of script `ntp' overrides LSB defaults (1).
校验:
systemctl is-enabled ntp
产量
ntp.service is not a native service, redirecting to systemd-sysv-install Executing /lib/systemd/systemd-sysv-install is-enabled ntp disabled