How to fix 'sudo: no tty present and no askpass program specified' error?

前端 未结 26 1682
失恋的感觉
失恋的感觉 2020-11-22 03:36

I am trying to compile some sources using a makefile. In the makefile there is a bunch of commands that need to be ran as sudo.

When I compile the sour

26条回答
  •  死守一世寂寞
    2020-11-22 04:10

    I was getting this error because I had limited my user to only a single executable 'systemctl' and had misconfigured the visudo file.

    Here's what I had:

    jenkins ALL=NOPASSWD: systemctl
    

    However, you need to include the full path to the executable, even if it is on your path by default, for example:

    jenkins ALL=NOPASSWD: /bin/systemctl
    

    This allows my jenkins user to restart services but not have full root access

提交回复
热议问题