Cannot import EC2 keypair (Length exceeds maximum) via AWS console from existing keypair

Solution 1:

You are trying to import the private ssh key file. You should be importing the public ssh key file only.

On Linux, you can extract the public key from the private key using:

ssh-keygen -y -f KEYPAIR.pem

Amazon EC2 does not need to know your private ssh key. You should keep this secret and not share it with anyone, not even Amazon.

Here's an article I wrote which describes my recommendation that you generate and upload your own default ssh key to EC2:

Uploading Personal ssh Keys to Amazon EC2
http://alestic.com/2010/10/ec2-ssh-keys

This makes it easier to work with and access EC2 instances, no matter what region you're running them in.