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

前端 未结 26 2145
失恋的感觉
失恋的感觉 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:02

    If you add this line to your /etc/sudoers (via visudo) it will fix this problem without having to disable entering your password and when an alias for sudo -S won't work (scripts calling sudo):

    Defaults visiblepw
    

    Of course read the manual yourself to understand it, but I think for my use case of running in an LXD container via lxc exec instance -- /bin/bash its pretty safe since it isn't printing the password over a network.

提交回复
热议问题