SSH EC2 asking for password

后端 未结 16 1609
伪装坚强ぢ
伪装坚强ぢ 2020-12-24 05:45

I\'ve just setup my EC2 server following this video here exactly - http://www.youtube.com/watch?v=bBajLxeKqoY

I even chose the same server type, everything went well

16条回答
  •  孤城傲影
    2020-12-24 06:28

    This is the way to connect:

    ssh -i /path/my-key-pair.pem ec2-user@public-ip
    

    Now, instead of ec2-user, it could be root, or centos, or ubuntu, or something else. You can check under the "Usage Instructions". If it's not there, and you've tried all the above users, find out from the documentation that came with the AMI.

    There is one bug on AWS that cost me a lot of time. If you're launching an instance from a saved AMI under "Images > AMIs", note that it uses the original keys of the running instance it was created from. When launching the AMI, it will prompt you to choose a new key, and even show such key under the description, but the truth is those keys will never work!

    So if you're using a custom/saved AMI you'll have to either get the original keys and use them, or just create a brand new one from AWS or the market place. If you haven't created the AMI or can't remember where it came from, look under the details tab. You can then launch a new instance or create a new AMI from the same source. This will then use the keys that you specify.

提交回复
热议问题