Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to conenct to a Gentoo AMI Gentoo_64-bit-EBS-2012-03-02-07-39-15 (ami-6ab26f03) for the first time via SSH with my Key Pair, but it's asking for a password. What is the default root password?

I replaced the IP with 99's:

hobbes3@hobbes3:~$ ssh root@ec2-99-99-99-99.compute-1.amazonaws.com
Password: 
share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

Actually it turned out that I needed to log in as ec2-user, then do sudo su -. Amazon incorrectly said to try logging in as root@... when you right click the instance and click Connect.

share|improve this answer
2  
That's going to depend on the specifics of the image. I recall the Ubuntu ones from Canonical uses user "ubuntu" as the login user, for example. The Amazon docs probably refer to what you'd do with the Amazon distro, not Gentoo nor Ubuntu. –  cjc Mar 7 '12 at 16:53
1  
Login users are "ec2-user" for most images, "ubuntu" for Ubuntu ones, and "admin" for Debian. –  LinuxDevOps Mar 31 at 16:37
add comment

There's a certain way about handling keypairs. Let's say in this example that we create a keypair called "1stKey". When I click "Create Key Pair" it asks me for a name and generates that key, then causes my browser to download the private key named "1stKey.pem". EC2 will never let me get that private half again, so unless you can find your $whatever.pem file, you'll need to generate a new one. You can also upload the public half of an already existing key.

enter image description here

From there, you'll do the usual ssh ec2-user@your.host -i path/to/your_key.pem. If you don't have the key that was used to create the instance, you'll need to terminate it and start fresh mount that EBS image to some other functioning instance and fix it or kick yourself for not using an EBS backing. At least for the default Amazon instances, there is no direct root access, but rather sudo access for ec2-user. Perhaps the people who generated your image followed that convention.

share|improve this answer
add comment

You didn't specify your ssh key by the looks of it so it's assuming you want to use a password. Most AMIs are configured to NOT allow ssh access for root with a password. Fix your parameters to ensure the key is being specified.

share|improve this answer
    
Thanks for the response. The instance has a Key Pair that I know works on a normal Amazon Linux instance. I also set a security group to allow port 22 (SSH) to all IPs. Where do I go to "fix [my] parameters to ensure the key is being specified"? –  hobbes3 Mar 7 '12 at 0:42
2  
@hobbes3 $ ssh -i ~/.ec2/ec2.pem root@ec2-99-99-99-99.compute-1.amazonaws.com or change ec2.pem to whatever your pem secret file you used to create the instance is located –  Tom H Mar 7 '12 at 2:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.