[ https://issues.apache.org/jira/browse/DTACLOUD-438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marios Andreou updated DTACLOUD-438: ------------------------------------ Attachment: 0001-Deltacloud-adds-EC2-driver-import-key-functionality-.patch This functionality requires changes in the appoxy/aws rubygem as well as on the Deltacloud side. The patch here implements the deltacloud side of things. I've opened a pull request against the aws gem on github [1] which will hopefully be merged soon. Until it is, you will need to build and install the rubygem from git://github.com/marios/aws.git [2] as well as applying the patch here. A note on the 'public_key_fingerprint' reported by AWS for imported keys (and keys in general): After you import a key - the fingerprint calculated by AWS will likely not match that calculated by you. This is because apparently [3] AWS report key fingerprints using DER format and not PEM. So for example: Amazon reports fingerprint as ==> 7d:bf:c6:a8:44:9a:7c:92:81:bf:5a:a9:37:c1:94:da But on your machine: ssh-keygen -lf id_rsa.pub ==> 95:bb:22:bb:be:9b:a3:15:00:fb:d0:a7:17:86:09:ff The good news is that there is a solution [3] - but this requires access to the private key (shouldn't be a problem - if you're importing a public key can safely assume you have the private key) - in the following 'id-rsa' is the private key: openssl pkey -in ./id_rsa -pubout -outform DER | openssl md5 -c ==> 7d:bf:c6:a8:44:9a:7c:92:81:bf:5a:a9:37:c1:94:da marios [1] https://github.com/appoxy/aws/pull/120 [2] mkdir AWS_GEM_BUILD; cd AWS_GEM_BUILD; git clone git://github.com/marios/aws.git; cd aws; gem build aws.gemspec; sudo gem install aws-2.6.0.gem [3] https://forums.aws.amazon.com/message.jspa?messageID=386670 [4] http://blog.jbrowne.com/?p=23 > Import SSH key into Amazon EC2 not working as expected > ------------------------------------------------------ > > Key: DTACLOUD-438 > URL: https://issues.apache.org/jira/browse/DTACLOUD-438 > Project: DeltaCloud > Issue Type: Bug > Components: Server > Reporter: Enrique Fernandez Casado > Assignee: Marios Andreou > Attachments: > 0001-Deltacloud-adds-EC2-driver-import-key-functionality-.patch > > > curl -X POST --user "user:pass" -F "name=mynewkey" -F "public_key=`cat > /location/of/public/key/id_rsa.pub`" > http://localhost:3001/api/keys?format=xml > seems to be creating a new SSH key (using the provided key name) rather than > importing the provided one -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira