-
Bug
-
Resolution: Unresolved
-
Minor
-
2.89.2
I am attempting to launch an EC2 node from Windows to a Linux instance on AWS.
Jenkins creates a ec2-xxxxx.pem file each time the node is launched. This pem file has permissions 0644. ssh throws an error
Permissions 0644 for 'C:\\Users\\jenkins\\AppData\\Local\\Temp
ec2_4216509555152975298.pem' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: C:\\Users\\jenkins\\AppData\\Local\\Temp
ec2_4216509555152975298.pem
Since this pem file is generated with a different name after a chmod through cygwin to give the correct permissions this file is no longer being use. How can you force Jenkins to create the temporary pem file with 600 permissions or something that ssh will accept?
Full output:
Jan 05, 2018 11:54:54 AM null FINEST: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is still stopping, waiting 5s Jan 05, 2018 11:55:00 AM null INFO: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is stopped, sending start request Jan 05, 2018 11:55:00 AM null INFO: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916): sent start request, result: {StartingInstances: [\{CurrentState: \{Code: 0,Name: pending},InstanceId: i-02abe6df5ecd20916,PreviousState: \{Code: 80,Name: stopped}}]} Jan 05, 2018 11:55:00 AM null FINEST: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is still pending/launching, waiting 5s Jan 05, 2018 11:55:06 AM null FINEST: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is still pending/launching, waiting 5s Jan 05, 2018 11:55:11 AM null FINEST: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is still pending/launching, waiting 5s Jan 05, 2018 11:55:16 AM null FINEST: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is still pending/launching, waiting 5s Jan 05, 2018 11:55:21 AM null FINEST: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is still pending/launching, waiting 5s Jan 05, 2018 11:55:27 AM null FINER: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is ready Jan 05, 2018 11:55:27 AM null INFO: Launching instance: i-02abe6df5ecd20916 Jan 05, 2018 11:55:27 AM null INFO: bootstrap() Jan 05, 2018 11:55:27 AM null INFO: Getting keypair... Jan 05, 2018 11:55:27 AM null INFO: Using key: Build 75:5e:d5:6d:78:ce:a5:a6:54:a4:c8:97:02:c0:04:ae:4d:6d:97:7d ----BEGIN RSA PRIVATE KEY---- MIIEpQIBAAKCAQEAlBFabtHX59vqin7IXZS+Ze9R77KrTNIzHVHdfer6tEnXQNTCERIGx56e5em+ qQVPHIcmYL0iiRDNdGLcIqlMQFufXwbWU2GPknSzGk+wBu2FjlC Jan 05, 2018 11:55:27 AM null INFO: Authenticating as ec2-user Jan 05, 2018 11:55:27 AM null INFO: Connecting to ec2-18-218-67-205.us-east-2.compute.amazonaws.com on port 22, with timeout 10000. Jan 05, 2018 11:55:36 AM null INFO: Failed to connect via ssh: There was a problem while connecting to ec2-18-218-67-205.us-east-2.compute.amazonaws.com:22 Jan 05, 2018 11:55:36 AM null INFO: Waiting for SSH to come up. Sleeping 5. Jan 05, 2018 11:55:41 AM null INFO: Connecting to ec2-18-218-67-205.us-east-2.compute.amazonaws.com on port 22, with timeout 10000. Jan 05, 2018 11:55:43 AM null INFO: Failed to connect via ssh: There was a problem while connecting to ec2-18-218-67-205.us-east-2.compute.amazonaws.com:22 Jan 05, 2018 11:55:43 AM null INFO: Waiting for SSH to come up. Sleeping 5. Jan 05, 2018 11:55:48 AM null INFO: Connecting to ec2-18-218-67-205.us-east-2.compute.amazonaws.com on port 22, with timeout 10000. Jan 05, 2018 11:55:49 AM null INFO: Connected via SSH. Jan 05, 2018 11:55:50 AM null INFO: connect fresh as root Jan 05, 2018 11:55:51 AM null INFO: Connecting to ec2-18-218-67-205.us-east-2.compute.amazonaws.com on port 22, with timeout 10000. Jan 05, 2018 11:55:51 AM null INFO: Connected via SSH. Jan 05, 2018 11:55:52 AM null INFO: Creating tmp directory (/tmp) if it does not exist Jan 05, 2018 11:55:52 AM null INFO: Verifying that java exists java full version "1.7.0_161-mockbuild_2017_12_19_23_46-b00" Jan 05, 2018 11:55:53 AM null INFO: Copying slave.jar Jan 05, 2018 11:55:58 AM null INFO: Launching slave agent (via SSH client process): ssh o StrictHostKeyChecking=no -i C:\Users\jenkins\AppData\Local\Temp\ec2_4374578292533530813.pem ec2-user@ec2-18-218-67-205.us-east-2.compute.amazonaws.com -p 22 java -jar /tmp/slave.jar [01/05/18 11:55:58] Launching agent $ ssh -o StrictHostKeyChecking=no -i C:\Users\jenkins\AppData\Local\Temp\ec2_4374578292533530813.pem ec2-user@ec2-18-218-67-205.us-east-2.compute.amazonaws.com -p 22 java -jar /tmp/slave.jar Warning: Permanently added 'ec2-18-218-67-205.us-east-2.compute.amazonaws.com,18.218.67.205' (RSA) to the list of known hosts. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for 'C:\\Users\\jenkins\\AppData\\Local\\Temp---- MIIEpQIBAAKCAQEAlBFabtHX59vqin7IXZS+Ze9R77KrTNIzHVHdfer6tEnXQNTCERIGx56e5em+ qQVPHIcmYL0iiRDNdGLcIqlMQFufXwbWU2GPknSzGk+wBu2FjlC Jan 05, 2018 12:16:44 PM null INFO: Authenticating as ec2-user Jan 05, 2018 12:16:45 PM null INFO: Connecting to ec2-18-218-67-205.us-east-2.compute.amazonaws.com on port 22, with timeout 10000. Jan 05, 2018 12:16:45 PM null INFO: Connected via SSH. Jan 05, 2018 12:16:46 PM null INFO: connect fresh as root Jan 05, 2018 12:16:46 PM null INFO: Connecting to ec2-18-218-67-205.us-east-2.compute.amazonaws.com on port 22, with timeout 10000. Jan 05, 2018 12:16:47 PM null INFO: Connected via SSH. Jan 05, 2018 12:16:47 PM null INFO: Creating tmp directory (/tmp) if it does not exist Jan 05, 2018 12:16:47 PM null INFO: Verifying that java exists java full version "1.7.0_161-mockbuild_2017_12_19_23_46-b00" Jan 05, 2018 12:16:48 PM null INFO: Copying slave.jar Jan 05, 2018 12:16:53 PM null INFO: Launching slave agent (via SSH client process): ssh -o StrictHostKeyChecking=no -i C:\Users\jenkins\AppData\Local\Temp\ec2_4216509555152975298.pem ec2-user@ec2-18-218-67-205.us-east-2.compute.amazonaws.com -p 22 java -jar /tmp/slave.jar [01/05/18 12:16:53] Launching agent $ ssh -o StrictHostKeyChecking=no -i C:\Users\jenkins\AppData\Local\Temp\ec2_4216509555152975298.pem ec2-user@ec2-18-218-67-205.us-east-2.compute.amazonaws.com -p 22 java -jar /tmp/slave.jar @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for 'C:\\Users\\jenkins\\AppData\\Local\\Temp
ec2_4374578292533530813.pem' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: C:\\Users\\jenkins\\AppData\\Local\\Temp
ec2_4374578292533530813.pem Jan 05, 2018 12:16:44 PM null FINER: Node AWS AMI (i-02abe6df5ecd20916)(i-02abe6df5ecd20916) is ready Jan 05, 2018 12:16:44 PM null INFO: Launching instance: i-02abe6df5ecd20916 Jan 05, 2018 12:16:44 PM null INFO: bootstrap() Jan 05, 2018 12:16:44 PM null INFO: Getting keypair... Jan 05, 2018 12:16:44 PM null INFO: Using key: Build 75:5e:d5:6d:78:ce:a5:a6:54:a4:c8:97:02:c0:04:ae:4d:6d:97:7d -----BEGIN RSA PRIVATE KEY
ec2_4216509555152975298.pem' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: C:\\Users\\jenkins\\AppData\\Local\\Temp
ec2_4216509555152975298.pem
Even I am facing the same issue.
I am unable to launch UBUNTU EC2 instance using EC2 plugin from WINDOWS machine. Getting error "Warning: Identity file C:\Windows\TEMP\ec2_471045675295473131.pem not accessible: No such file or directory.
ubuntu@'public ip address': Permission denied (publickey)."
Please help me in resolving this issue.