0

I’ve created a user called ‘deploy’ on my remote server and I’ve tried adding my public id_rsa.pub key to its .ssh/authorized_keys file (which I created), but I can’t connect to it. When I try to ssh into it I get "Permission denied (publickey)."

Here's what I've tried so far:

  1. Placing my rsd_id.pub key into the 'deploy' user's .ssh/authorized_keys file using:

    sudo su - deploy

    echo "long string key here" >> .ssh/authorized_keys

Then I cat .ssh/authorized_keys to confirm it's really there, which it is.

Then sshing by doing

ssh [email protected] 'hostname; uptime'

I get the same Permission denied (publickey) with that.

  1. I placed the rsa_id.pub key inside aws's keypairs. Same error.

What might be the issue here?

1
  • 1
    Are you sure that the ssh client is using the correct private key? Try specifying it exlicitly using the -i switch, e.g.: ssh -i ~/.ssh/my_private_key ... Mar 12, 2015 at 17:49

1 Answer 1

0

I believe the answer was to change the permissions for my .ssh and .ssh/authorized_keys director and file to 700 and 600 respectively. I thought I'd done this already but it now works. Who'd have known!?

You must log in to answer this question.

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