简体   繁体   中英

Prompted for password by ssh when trying to connect to Amazon EC2 instance

I've followed a couple of tutorials for creating an Amazon EC2 instance using the command line tools

http://www.zabada.com/tutorials/deploying-a-rails-application-to-production-on-amazon-ec2.php http://www.smartfrog.org/wiki/display/sf/Starting+an+EC2+Image+by+Hand

and all is well, i

  • ec2-add-keypair (directing the output of ec2-add-keypair directly to a file in ~/.ssh)
  • chmod 600 the keypair
  • ec2-run-instance
  • ec2-describe-instances

then, when the new instance is running try to ssh on

ssh -i ~/.ssh/ec2-keypair ec2-user@foo.bar.amazon.com

At this point i'm ALWAYS prompted for a password. Obviously there's no password so it always refuses me access.

My question is, what am i doing wrong here? Why am i being prompted for a password and how can i put this right so i can ssh onto the machine i've just started?

I'm guessing this is something to do with my local setup, but as far as i know this machine hasn't had anything custom done with .ssh (there's certainly no config file or anything like that lying around that might be screwing with things).

Anyone have any ideas or suggestions?

ec2-user@ ? Why not root@ ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM