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 [email protected]

3 Answers 3


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.

  • 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
    Commented Mar 7, 2012 at 16:53
  • 2
    Login users are "ec2-user" for most images, "ubuntu" for Ubuntu ones, and "admin" for Debian. Commented Mar 31, 2014 at 16:37

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 [email protected] -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.


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.

  • 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
    Commented Mar 7, 2012 at 0:42
  • 2
    @hobbes3 $ ssh -i ~/.ec2/ec2.pem [email protected] or change ec2.pem to whatever your pem secret file you used to create the instance is located
    – Tom
    Commented Mar 7, 2012 at 2:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .