Jenkins sudo: no tty present and no askpass program specified with NOPASSWD

后端 未结 3 1269
不思量自难忘°
不思量自难忘° 2021-02-04 00:47

I spend several days setting up the file /etc/sudoers to be able to give permissions to root to the user jenkins. I have Jenkins installed on my server

3条回答
  •  野的像风
    2021-02-04 01:16

    This is just a response to elaborate on the steps to take to fix the issue.

    First thing, figure out which user Jenkins GUI is using to execute the bash shell script.

    select the project > Configure > enter whoami in the executable shell > save and Build Now. View result in build history > click console output

    User may be tomcat or jenkins or whatever.

    SSH into Jenkins server

    1. sudo su
    2. visudo
    3. tomcat ALL=(ALL) NOPASSWD: ALL #if user displayed is tomcat

提交回复
热议问题