views:

426

answers:

2

Is there a way to log into an EC2 ubuntu ami or a way to set up an ubuntu ami so that non-root users can log in? I tried creating a user and logging in with the associated password. I also tried using the private key, copied the authorized-keys file into the .ssh directory of the non-root user's home directory and tried to log in to the box with that user account id. Neither method worked.

Thanks in advance.

+1  A: 

Make sure you are sending your AWS keypair as the identity file, i.e.

ssh -i ~/.ssh/keypair.pem [email protected]

Also check that SSH is enabled in your security group

AdamK
This was basically what I did at first, but your comment reminded me that I did not set the permissions on the authorized-keys file correctly.
jortiz81
+1  A: 

So, this works, but the missing high-order bit of information here has to do with setting the right permission on the authorized-keys file in the home directory for the user. So, I copied /root/.ssh/authorized-key to /home/user, then did with

cp -r /root/.ssh /home/user

chown -R user /home/user/.ssh

This allowed me to use the keypair.pem file to log in.

jortiz81