我花了几天时间设置文件/etc/sudoers
,以便能够给用户jenkins
授予root权限。我在我的服务器上安装了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