如果没有 sudo,ddclient 将无法运行

如果没有 sudo,ddclient 将无法运行

当我不使用 sudo 运行 ddclient (DynamicDns Updator) 时,我得到

WARNING:  file /etc/ddclient.conf: Cannot open file '/etc/ddclient.conf'. (Permission denied)
stat() on closed filehandle FD at /usr/sbin/ddclient line 934.
Use of uninitialized value $mode in bitwise and (&) at /usr/sbin/ddclient line 935.
readline() on closed filehandle FD at /usr/sbin/ddclient line 947.
WARNING:  file /etc/ddclient.conf: Cannot open file '/etc/ddclient.conf'. (Permission denied)
stat() on closed filehandle FD at /usr/sbin/ddclient line 934.
Use of uninitialized value $mode in bitwise and (&) at /usr/sbin/ddclient line 935.
readline() on closed filehandle FD at /usr/sbin/ddclient line 947.
WARNING:  file /var/cache/ddclient/ddclient.cache: Cannot open file '/var/cache/ddclient/ddclient.cache'. (Permission denied)
stat() on closed filehandle FD at /usr/sbin/ddclient line 934.
Use of uninitialized value $mode in bitwise and (&) at /usr/sbin/ddclient line 935.
readline() on closed filehandle FD at /usr/sbin/ddclient line 947.

但是它与 sudo 配合得很好。

我需要chmod一些文件吗?如果需要,请解释一下。

答案1

在默认设置中,root 运行dd客户端作为守护进程使用来自的设置/etc/ddclient.conf。运行时选项在中定义/etc/default/ddclient

我们可以使用以下选项通过另一个配置文件启动 ddclient:

ddclient -file <path>

有关更多选项,另请参阅ddclient 维基

不建议更改默认文件的权限,因为这可能会导致安全问题。

相关内容