Uday Reddy
Uday Reddy

Reputation: 1481

Authentication error in jenkins on using sudo

I have sh script in jenkins which has sudo ssh command and I am getting this error

Warning: Identity file key.pem not accessible: Permission denied.
Host key verification failed.
sudo: no tty present and no askpass program specified

I have found solutions saying add

jenkins ALL=(ALL) ALL

these lines in /etc/sudoers but still its not working.

Upvotes: 15

Views: 33309

Answers (2)

Uday Reddy
Uday Reddy

Reputation: 1481

sudo su    
visudo -f /etc/sudoers

add add following line at the end.

jenkins ALL= NOPASSWD: ALL

Upvotes: 46

Raghavendra
Raghavendra

Reputation: 9

username ALL= NOPASSWD: ALL in sudoers worked in ubuntu server 12.04.2

Upvotes: 0

Related Questions