How do I set up SSH access for an Amazon EC2 instance?

后端 未结 13 1299
挽巷
挽巷 2021-01-29 19:20

I need SSH access to an Amazon EC2 instance running Ubuntu 10.4. All I have is the Amazon username and password. Any ideas?

13条回答
  •  死守一世寂寞
    2021-01-29 19:38

    Not logging in as the correct user for you OS Distro could be the issue. For certain new AMI, the username may not be "ubuntu", but "ec2-user". For Amazon Linux, for instance I believe the user is "ec2-user". Eric Hammond gives examples here: http://alestic.com/2014/01/ec2-ssh-username

    My suggestion, try:

    ssh -i /path/to/file.pem ec2-user@ec2...
    
    ssh -i /path/to/file.pem ubuntu@ec2...
    
    ssh -i /path/to/file.pem root@ec2...
    

    If you have the wrong AMI, you might just want to restart the machine altogether so you have uniformity amongst your clusters. If this is your problem, you'll probably want the same OS Distro's at least for your linux boxes.

提交回复
热议问题