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

后端 未结 3 1266
不思量自难忘°
不思量自难忘° 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:34

    I've tested the solution described by @Jayan in the comments of the question. You must include the new line at the end of the file:

    Solution: https://stackoverflow.com/a/24648413/54506

    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # Please consider adding local content in /etc/sudoers.d/ instead of
    # directly modifying this file.
    #
    # See the man page for details on how to write a sudoers file.
    #
    Defaults    env_reset
    Defaults    mail_badpass
    Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    
    # Host alias specification
    
    # User alias specification
    
    # Cmnd alias specification
    
    # User privilege specification
    root    ALL=(ALL:ALL) ALL
    
    # Allow members of group sudo to execute any command
    %sudo   ALL=(ALL:ALL) ALL
    jenkins ALL=(ALL) NOPASSWD: ALL
    

提交回复
热议问题