티스토리 뷰

Jenkins에서 Execute Shell을 통해 sudo를 사용해서 어떤 작업을 하려고 했다. 

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified

그때 이런 메세지가 나오며 Job이 fail이 되었다. 

 

Jenkins를 설치할때 jenkins라는 계정이 생성되었고 이 계정에는 admin 권한을 주지 않았는데 sudo를 사용하려고 해서 발생한 문제이다. 

 

sudo를 사용하지 말거나 jenkins 계정에 권한을 주어 문제를 해결할 수 있다. jenkins 계정에 권한을 주려면 다음과 같이 하면 된다. 

# vi /etc/sudoers

...
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
jenkins ALL=(ALL)       ALL

이렇게 jenkins 계정에 권한을 주면 sudo 를 사용할 수 있게 된다. 

 

끝!

댓글
최근에 올라온 글
최근에 달린 댓글
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30