Amazon EC2 linux user accounts

0

I have a Linux AMI setup on EC2. The default user is ec2-user. I created a second user account on the instance. I copied the .ssh/authorized_keys file from ec2-user home directory to the new user's home directory. Set the privs on .ssh/ to 700 and on authorized_keys to 600. Executed 'chown' to set owner of the .ssh/ folder as the new user. But when I log in as the new user, I get a 'Permission denied (publickey).' message. Here is what I see when I run ssh -v -i:

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: testami-key.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

How do I fix this? Thanks.

sotn

Posted 2013-01-08T23:16:07.580

Reputation:

What's the log file on the server saying? /var/log/secure – Michel Feldheim – 2013-01-08T23:23:00.310

Did you generate a private key, etc... per http://aws.amazon.com/articles/1233?

– None – 2013-01-08T23:24:27.723

Answers

2

Did you also chown the authorized_keys file to the new user name? You only mentioned chowning the .ssh directory.

ers81239

Posted 2013-01-08T23:16:07.580

Reputation:

Thank you! Thank you! Was struggling with this for several hours. Will accept answer when SO limitation expires. – None – 2013-01-08T23:31:20.233