新创建一个用户,在使用的过程中提示该用户“jenkins 不在sudoers 文件中。此事将被报告。”解决这个问题的方案如下:
修改/etc/sudoers这个文件的内容,将创建的用户添加进去就可以了。
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
jenkins ALL=(ALL) ALL
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
## Allows members of the users group to mount and unmount the
## cdrom as root
# %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom
## Allows members of the users group to shutdown this system
# %users localhost=/sbin/shutdown -h now
## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d
这样就可以了。