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

importing own private/pub to AWS ec2 doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: ec2-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      Hello,

      I'm on Jenkins LTS v1.565.2 + ec2 plugin v1.24

      I already have my own key pair as we now are trying migrate to using ec2 plugin for autoscaling, so I import my own keypairs on AWS EC2 console, but now supplying the same private key to ec2 plugin don't seem to work. I do see an ec2 instance is created and running, just can't get Jenkins ssh into that slave.

      Node aws builder (i-83605288)(i-83605288) is still stopping, waiting 5s
      Node aws builder (i-83605288)(i-83605288) is still stopping, waiting 5s
      Node aws builder (i-83605288)(i-83605288) is still stopping, waiting 5s
      Node aws builder (i-83605288)(i-83605288) is ready
      Connecting to ip-1-2-3-4.us-west-2.compute.internal on port 22, with timeout 10000.
      Waiting for SSH to come up. Sleeping 5.
      Connecting to ip-1-2-3-4.us-west-2.compute.internal on port 22, with timeout 10000.
      Connected via SSH.
      bootstrap()
      Getting keypair...
      Using key: jenkins-builder
      0f:64:0d:18:40:d3:f0:04:45:de:84:ab:39:20:7f:42
      -----BEGIN RSA PRIVATE KEY-----
      MIIEoQIBAAKCAQEAzEibczy885OzrUb4DCsPueOSok1uUgSAMPLEabcdefgehef
      UzGGq+6qVCSHtGpjJXlK+DFDBADFEWRX+W7CifKEspRasZsC3hhHC3BnCbH7fuB
      Authenticating as 4g ruby  dummy dummy2 aws m3.medium
      Authentication failed. Trying again...
      Authenticating as 4g ruby  dummy dummy2 aws m3.medium
      Authentication failed. Trying again...
      Authenticating as 4g ruby  dummy dummy2 aws m3.medium
      Authentication failed. Trying again...
      Authenticating as 4g ruby  dummy dummy2 aws m3.medium
      Authentication failed. Trying again...
      Authenticating as 4g ruby  dummy dummy2 aws m3.medium
      Authentication failed. Trying again...
      Authenticating as 4g ruby  dummy dummy2 aws m3.medium
      ERROR: Publickey authentication failed.
      java.io.IOException: Publickey authentication failed.
      	at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:315)
      	at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:467)
      	at hudson.plugins.ec2.ssh.EC2UnixLauncher.bootstrap(EC2UnixLauncher.java:194)
      	at hudson.plugins.ec2.ssh.EC2UnixLauncher.launch(EC2UnixLauncher.java:82)
      	at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:101)
      	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:228)
      	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.IOException: The connection is closed.
      	at com.trilead.ssh2.auth.AuthenticationManager.deQueue(AuthenticationManager.java:63)
      	at com.trilead.ssh2.auth.AuthenticationManager.getNextMessage(AuthenticationManager.java:86)
      	at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:290)
      	... 10 more
      Caused by: java.io.IOException: Peer sent DISCONNECT message (reason code 2): Too many authentication failures for 4g ruby  dummy dummy2 aws m3.medium
      	at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:755)
      	at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:480)
      	... 1 more
      

        Attachments

          Issue Links

            Activity

            Hide
            baldzern4 Joerg Baldzer added a comment -

            Hello,
            we are having the same issue running Jenkins LTS v1.619 + ec2 plugin v1.29.
            Providing our own private key doesn't work with the ec2 plugin. The provided key works while manually connecting to the instance via ssh.
            BR,

            Show
            baldzern4 Joerg Baldzer added a comment - Hello, we are having the same issue running Jenkins LTS v1.619 + ec2 plugin v1.29. Providing our own private key doesn't work with the ec2 plugin. The provided key works while manually connecting to the instance via ssh. BR,

              People

              • Assignee:
                francisu Francis Upton
                Reporter:
                samxiao Sam Xiao
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: