amphibient
amphibient

Reputation: 31358

How to enable sudo from Jenkins SSH plugin?

I tried running a sudo command from the Jenkins SSH plugin but got the following error:

sudo: sorry, you must have a tty to run sudo

My Jenkins job needs to be able to stop and start a service and I was unable to enable the remote user to do it without sudo.

Is there any way to enable sudo-ing from Jenkins?

Upvotes: 0

Views: 2932

Answers (1)

amphibient
amphibient

Reputation: 31358

I managed to enable sudo from Jenkins by changing sudoers on the remote host (SSH target) to not require tty:

#Defaults    requiretty

Upvotes: 1

Related Questions