views:

718

answers:

4

Hi,

I have setup an amazon EC2 intance using the command line tools. I have create a key pair for it etc. and it is up and running. I try to SSH into it using the following (I am running bash in Snow Leopard):

$ ssh -i ec2-keypair [email protected]

Snow Leopard pops up a box saying "Enter you password for the SSH key "ec2-keypair" ". Can someone please tell me what I should do? If I don't provide a password its just asks me for one in the bash terminal.

Thanks for the response. I create a key pair for Amazon EC2 using:

ec2-add-keypair ec2-keypair

I have create a password protected sash key and now have two files in my .ssh directory: *id_rsa id_rsa.pub*

Do I need to transfer one of these to my EC2 instance? Which one? What is the best way of doing this and where shall I put?

Max.

Any help greatly appreciated as I have spent some while trying to sort this out.

Max.

A: 

If I remember correctly when you set up your ssh keys you are prompted to type a passphrase twice. Most of the time you can just press enter twice, leaving the pass phrase blank.

Have you tried just submitting a blank passphrase?

Anon
Thanks for the response. I create a key pair for Amazon EC2 using:ec2-add-keypair ec2-keypairI have create a password protected sash key and now have two files in my .sash directory:id_rsaid_rsa.pubDo I need to transfer one of these to my EC2 instance? Which one? What is the best way of doing this and where shall I put?Max.
user7289
Typically the .pub key goes in ~/.ssh/authorized_keys on the remote machine.If you are running some flavor of linux/unix locally then you might look into "ssh-copy-id" to make the process easier.Or you can use "scp" to move the public key to the remote machine's authorized hosts location. Hope that helps.
Anon
Oh yeah, you're using snow leopard, so basically free bsd, so ssh-copy-id should prbbly work fine for you.
Anon
A: 

It is just asking for the password you supplied when you created the key pair. If you didn't supply one then just enter nothing and click OK, otherwise enter the password to continue.

Simon
Thanks for the response. I create a key pair for Amazon EC2 using:ec2-add-keypair ec2-keypairI have create a password protected sash key and now have two files in my .sash directory:id_rsaid_rsa.pubDo I need to transfer one of these to my EC2 instance? Which one? What is the best way of doing this and where shall I put?Max.
user7289
A: 

When creating the key pair its best to pipe the output straight into a file so that there are no formatting issues, using:

ec2-add-keypair ec2-keypair | sed '1d' > ec2-keypair

Max.

user7289
A: 

As you accepted Max's answer already maybe you're OK now, but you can get that error if the permissions on your keypair file are too permissive. chmod it to 600 (owner read/write, group and all no permisions) and you should be OK.

gareth_bowles