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

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

    After all alternatives, I found:

    sudo -S 
    

    The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device.

    Source

    Above command still needs password to be entered. To remove entering password manually, in cases like jenkins, this command works:

    echo  | sudo -S  
    

提交回复
热议问题