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.

migrated from stackoverflow.com Jan 9 '13 at 1:56

This question came from our site for professional and enthusiast programmers.

2

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

  • Thank you! Thank you! Was struggling with this for several hours. Will accept answer when SO limitation expires. – sotn Jan 8 '13 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy