Jenkins build job that SSH into another server to run shell coman

Hi all,

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

Issue

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.
  • post-author-pic
    Brandon B
    10-05-2018

    Is the user issuing the command root or have sudo privileges? Do you have an error you can share with us?

  • post-author-pic
    John M
    10-05-2018

    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.

  • post-author-pic
    Shakeel J
    10-08-2018

    user_220923_5bbba57f55659.JPG


    i just cannot run privelege user command, even though i added ansible user to the wheel group 

Looking For Team Training?

Learn More