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

Allow Amazon EC2 Plugin to not require root access

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: ec2-plugin
    • Labels:
      None
    • Environment:
      Hudson v1.348 and Hudson Amazon EC2 plugin v1.6
    • Similar Issues:

      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

          Hide
          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.

          Show
          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.
          Hide
          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

          Show
          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
          Hide
          francisu Francis Upton added a comment -

          Fixed for 1.14

          Show
          francisu Francis Upton added a comment - Fixed for 1.14
          Hide
          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.

          Show
          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.
          Hide
          yclian YC Lian added a comment - - edited

          Hi, I can confirm what Mauricio Walters 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.

          Show
          yclian YC Lian added a comment - - edited Hi, I can confirm what Mauricio Walters 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.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: