[JIRA] (JENKINS-5853) Allow Amazon EC2 Plugin to use ssh keys other than the EC2 private key

3 views
Skip to first unread message

ben@fogbutter.com (JIRA)

unread,
Jul 13, 2016, 8:17:01 PM7/13/16
to jenkinsc...@googlegroups.com
Ben Jones commented on New Feature JENKINS-5853
 
Re: Allow Amazon EC2 Plugin to use ssh keys other than the EC2 private key

I apologize for bringing such an old topic back up, but I encountered an issue related to this today.

The problem I see is that jobs being run on an EC2 slave are able to obtain root privileges on that slave. This may be just fine for some setups, but it obviously has the potential to introduce quite a bit of irritation and chaos (or worse) as well.

To prevent this, I would like to have the master connect to an ec2 slave using the configured remote user, but with a key separate from that which the instance was launched with.

Using a base Ubuntu image as an example, I'm currently restricted to using 'ubuntu' as the remote user and connecting with the key the instance was launched with. Instead I would like to connect as 'jenkins' with some other key entirely (the assumption is that I created this user appropriately via user data, pre-baked ami, etc.).

I could just generate an authorized_keys entry for that user by generating a public key from the private key, which I suppose is just fine, but it doesn't seem like an intuitive solution.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

greg@jauntvr.com (JIRA)

unread,
Sep 22, 2016, 7:27:02 PM9/22/16
to jenkinsc...@googlegroups.com

We had already been using manually launched EC2 instances using the built-in ssh credentials management to log into a "jenkins" account using a dedicated ssh key. I just want to be able to select one of my existing ssh credentials in the Amazon EC2 plugin so that it would work just like the normal ssh agent configuration, but there is no way to do this.

biao_ye@hotmail.com (JIRA)

unread,
Apr 13, 2018, 1:43:04 PM4/13/18
to jenkinsc...@googlegroups.com

Forked v1.40 and removed the Generate Key button to use SSH Private Key. Click here to try it out.

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

johnlabarge@gmail.com (JIRA)

unread,
Apr 17, 2020, 7:21:06 PM4/17/20
to jenkinsc...@googlegroups.com

This feature is needed for me too.  Enterprises do not allow access to pem files generally. 

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages