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:
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.
- I placed the rsa_id.pub key inside aws's keypairs. Same error.
What might be the issue here?
-i
switch, e.g.:ssh -i ~/.ssh/my_private_key ...