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 root@ec2-xxx-xxx-xx-xx.compute-1.amazonaws.com
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开发者_Go百科 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.
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.
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.
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?
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.
If you're running an Ubuntu image you'll want to use the user 'ubuntu' instead of root for the micro instances. I'm not sure about other ones but for micro you do.
so at the prompt it would look like
$ ssh -i ec2-keypair ubuntu@ec2-xxx-xxx-xx-xx.compute-1.amazonaws.com
The username should be ec2-user and not root. ssh Like this
$ ssh -i ec2-keypair ec2-user@ec2-xxx-xxx-xx-xx.compute-1.amazonaws.com
精彩评论