Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon EC2 instance

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.

like image 480
user7289 Avatar asked Jul 12 '26 04:07

user7289


2 Answers

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.

like image 129
gareth_bowles Avatar answered Jul 14 '26 16:07

gareth_bowles


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.

like image 45
user7289 Avatar answered Jul 14 '26 17:07

user7289