我想使用当Gnome调度器运行以下命令:
sudo service fancontrol start 由于"sudo“需要密码,我如何将其添加到命令中,以便成功运行?每次铸币机在暂停后恢复时,都需要再次运行。
发布于 2019-02-09 06:03:02
我建议修改sudoers (或者,更好的是因为清洁工,为此向/etc/sudoers.d/添加一个单独的文件),而不是想知道如何将密码输入脚本。
比如(假设matthew是你的用户名):
cat /etc/sudoers.d/fancontrol
matthew ALL=NOPASSWD: /usr/sbin/service fancontrol start确保它具有正确的权限,并且最好使用visudo来编辑它(这可以确保文件中没有语法错误)。
chmod 0440 /etc/sudoers.d/fancontrolhttps://unix.stackexchange.com/questions/499604
复制相似问题