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

Allow Amazon EC2 Plugin to not require root access

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • ec2-plugin
    • None
    • Hudson v1.348 and Hudson Amazon EC2 plugin v1.6

      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!

          [JENKINS-5867] Allow Amazon EC2 Plugin to not require root access

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

          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/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

          Francis Upton added a comment -

          Fixed for 1.14

          Francis Upton added a comment - Fixed for 1.14

          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.

          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.

          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.

          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
            gregcoit gregcoit
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: