Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my first foray into using EC2, and I created my first instance using an Amazon AMI running Ubuntu 12.04. I created a keypair and downloaded the .pem file to my local machine. I was able to connect via SSH via the ubuntu user just fine. I then created another user using the useradd command, and after a few tries, it was finally created. However, somehow in the process of creating that user, the default ubuntu user was deleted. I logged out of the instance, and now when I try to log in as my new user account, I get "Permission denied (access key)." I didn't have my public key created in my .ssh directory for my new user on the server, but even so, shouldn't I still be able to use SSH with my password? That's what has worked for me on other servers.

I've tried importing another key pair in the management console, but that hasn't helped. In terms of access groups, I just have the default group that grants access on port 22.

If I can't get in, it seems my only other option is to delete the instance and create another one. Is there a way to access the one I have?


share|improve this question
up vote 4 down vote accepted

Many EC2 AMIs, especially Ubuntu's, have SSH password authentication disabled by default. So if you don't have a key in place, you can't log in, at all.

If you only just created the instance, then delete it and start over.

share|improve this answer
Save a snapshot before making major changes. Messing with anything that changes admin access is a major change. It's easier to step back than to recover with EC2. – Fiasco Labs Jun 2 '13 at 19:18

Your Answer


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.