Jenkins build job that SSH into another server to run shell coman
Posted on: Oct 05, 2018by: Shakeel J
1)I installed Jenkins on Amazon linux Ami
2)Installed SSH plugin to SSH into another terminal
3)Configured another terminal inside Jenkin (Configure System - Publish over SSH)
4) I created a build job - which sends file or execute commands over ssh and I am able to run command such as mkdir, ping , touch etc
When i try using command that require root permission for example yum install unzip , the build job fails. Can someone help what i could be doing wrong and what i need to set in order to accomplish this task.
Is the user issuing the command root or have sudo privileges? Do you have an error you can share with us?
You may need to use visudo to allow sudo for the user that owns Jenkins. You may also need to edit the OpenSSH config file on the target to allow privilege escalation. The Plugin should have threads on the requirements beyond the Jenkins config.
i just cannot run privelege user command, even though i added ansible user to the wheel group