【发布时间】:2016-10-02 21:14:35
【问题描述】:
我花了几天时间设置文件/etc/sudoers,以便能够将root权限授予用户jenkins。我在我的服务器上安装了 Jenkins,因为我用 symfony、ionic、neo4j 等托管了几个项目......问题是我不能用 ionic 构建项目,我收到这个错误:sudo: no tty present and no askpass program specified.这是内容我的 /etc/sudoers 文件:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
jenkins ALL=(ALL) NOPASSWD: ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
【问题讨论】:
-
请看*.com/a/24648413/54506(它谈到了一行应该在sudoers的最后一行..)
-
请记住,这些
sudoers设置需要在进行构建的特定节点上进行设置,而不必是master。