Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5867

Allow Amazon EC2 Plugin to not require root access

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • ec2-plugin
    • None
    • Hudson v1.348 and Hudson Amazon EC2 plugin v1.6

    Description

      the Amazon EC2 Plugin requires root access - either by ssh'ing to to root or requiring the non-root user to have sudo. Our slave AMI's are designed to use the user "hudson" - no root access is required for the slave to do it's work.

      The solution here is to use the "Remote user" dir if no "Root command prefix" is given (rather than assuming root).

      Thanks!

      Attachments

        Activity

          gregcoit gregcoit created issue -
          mike_goins Mike Goins added a comment -

          One annoying effect of this bug is that non-EC2 machines have a different environment than EC2 instances due to being root.

          The patch fixes this issue by only re-connecting as root if "root Command Prefix" is specified in the configuration, else it returns SAMEUSER.

          mike_goins Mike Goins added a comment - One annoying effect of this bug is that non-EC2 machines have a different environment than EC2 instances due to being root. The patch fixes this issue by only re-connecting as root if "root Command Prefix" is specified in the configuration, else it returns SAMEUSER.
          mike_goins Mike Goins made changes -
          Field Original Value New Value
          Attachment ec2-reconnect-root-handling.patch [ 21221 ]
          francisu Francis Upton made changes -
          Assignee Kohsuke Kawaguchi [ kohsuke ] francis Upton [ francisu ]
          francisu Francis Upton made changes -
          Status Open [ 1 ] In Progress [ 3 ]

          Code changed in jenkins
          User: Frank Bille
          Path:
          .gitignore
          pom.xml
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          src/main/java/hudson/plugins/ec2/EC2Computer.java
          src/main/java/hudson/plugins/ec2/EC2ComputerLauncher.java
          src/main/java/hudson/plugins/ec2/EC2PrivateKey.java
          src/main/java/hudson/plugins/ec2/EC2Slave.java
          src/main/java/hudson/plugins/ec2/Eucalyptus.java
          src/main/java/hudson/plugins/ec2/InstanceState.java
          src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java
          src/main/java/hudson/plugins/ec2/ssh/HostKeyVerifierImpl.java
          src/test/java/hudson/plugins/ec2/ListRegions.java
          src/test/java/hudson/plugins/ec2/SlaveTemplateTest.java
          src/test/java/hudson/plugins/ec2/TemplateLabelsTest.java
          http://jenkins-ci.org/commit/ec2-plugin/104e585c8129e9c485a18356dc4e0402b6ec6414
          Log:
          [FIXED JENKINS-12539] Convert to Amazon AWS libraries
          [FIXED JENKINS-5867] Allow Amazon EC2 Plugin to not require root access

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Frank Bille Path: .gitignore pom.xml src/main/java/hudson/plugins/ec2/EC2Cloud.java src/main/java/hudson/plugins/ec2/EC2Computer.java src/main/java/hudson/plugins/ec2/EC2ComputerLauncher.java src/main/java/hudson/plugins/ec2/EC2PrivateKey.java src/main/java/hudson/plugins/ec2/EC2Slave.java src/main/java/hudson/plugins/ec2/Eucalyptus.java src/main/java/hudson/plugins/ec2/InstanceState.java src/main/java/hudson/plugins/ec2/SlaveTemplate.java src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java src/main/java/hudson/plugins/ec2/ssh/HostKeyVerifierImpl.java src/test/java/hudson/plugins/ec2/ListRegions.java src/test/java/hudson/plugins/ec2/SlaveTemplateTest.java src/test/java/hudson/plugins/ec2/TemplateLabelsTest.java http://jenkins-ci.org/commit/ec2-plugin/104e585c8129e9c485a18356dc4e0402b6ec6414 Log: [FIXED JENKINS-12539] Convert to Amazon AWS libraries [FIXED JENKINS-5867] Allow Amazon EC2 Plugin to not require root access
          francisu Francis Upton added a comment -

          Fixed for 1.14

          francisu Francis Upton added a comment - Fixed for 1.14
          francisu Francis Upton made changes -
          Fix Version/s current [ 10162 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          nvitius Mauricio Walters added a comment - - edited

          I've recently started using the EC2 plugin and I can't get it to log in as a user other than root. Looking through the code, it seems like the patch that is assigned to this ticket was never implemented.

          EDIT - I'm only seeing the issue on Spot Instances.

          nvitius Mauricio Walters added a comment - - edited I've recently started using the EC2 plugin and I can't get it to log in as a user other than root. Looking through the code, it seems like the patch that is assigned to this ticket was never implemented. EDIT - I'm only seeing the issue on Spot Instances.
          nvitius Mauricio Walters made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          yclian YC Lian added a comment - - edited

          Hi, I can confirm what nvitius said. I am using the EC2 plugin and having problem to build from a non-root user on a spot instance.

          Updated: I retract what I said, it could be managed by controlling the user executing the userdata script.

          yclian YC Lian added a comment - - edited Hi, I can confirm what nvitius said. I am using the EC2 plugin and having problem to build from a non-root user on a spot instance. Updated : I retract what I said, it could be managed by controlling the user executing the userdata script.
          francisu Francis Upton made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]
          francisu Francis Upton made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 135959 ] JNJira + In-Review [ 203771 ]

          People

            francisu Francis Upton
            gregcoit gregcoit
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: