atack
atack

Reputation: 55

How to use a new key pair downloaded from Amazon EC2?

Attempting to download a new Key Pair as I am about to Launch a new Amazon EC2 Instance. When I click to download, here is what I am seeing in Keychain Access:

An error has occurred. Unable to import an item. The contents of this item cannot be retrieved.

Unsuccessful solution attempts include:

  1. Running security import pub_key.pem -k ~/Library/Keychains/login.keychain in terminal

  2. Clicking to Lock and then Unlock Login in Keychain Accesss

  3. rm ida_rsa.pub, rm ida_rsa, and all other old .pem's in ~/.ssh

Upvotes: 0

Views: 1329

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270039

It appears that you are experiencing a problem when opening the .pem file that was downloaded to your computer.

This is because a .pem file is not intended to be run. Rather, it is used by an ssh command to access the instance. For example:

ssh -i keypair.pem [email protected]

The ssh command uses the keypair, but the keypair itself is just a data file and is not intended to be 'opened'.

Some alternatives to using ssh and keypairs are:

Upvotes: 1

Related Questions