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

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

    In Jenkins:

    echo '' | sudo -S command
    

    Eg:-

    echo '******' | sudo -S service nginx restart
    

    You can use Mask Password Plugin to hide your password

提交回复
热议问题