Reputation: 693
I have a server on digitalocean and I want to connect it to git. (not even push anything, just connect).
When I test my connection with: ssh -T [email protected]
.
I get an error of [email protected]: Permission denied (publickey).
I have tried everything to try to make the connection work. On my computer the connection works, and the key on my root server is linked to my local id_rsa
. The key is the same and I checked this with ssh-keygen -l -E md5 -f ~/.ssh/id_rsa.pub
on both my server and computer.
I am following this tutorial: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-laravel-application-with-nginx-on-ubuntu-16-04
Any ideas? I am stuck and going insane.
Upvotes: 3
Views: 4214
Reputation: 1644
You should add the public key created on your server on github.
1) On your server, copy the public key:
cat ~/.ssh/id_rsa.pub
2) Access: https://github.com/settings/keys
3) Click on "New ssh key" and paste you public key.
Upvotes: 2
Reputation: 1452
Recently I faced a similar issue on digital ocean.
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
Hope this helps and that it is the cause of your problem.
Upvotes: 6