git push origin master: permission denied (public key) error

后端 未结 2 2015
暖寄归人
暖寄归人 2021-02-09 11:53

I have set up a git repo on my amazon ec2 ubuntu server instance. I have been trying to push the code onto the server\'s repo from my local machine. The steps that I followed ar

2条回答
  •  无人及你
    2021-02-09 12:26

    One step you seem to have missed (or didn't include in your description) is the publication of the public key on the server side.
    Upload your public ssh key and add it to the ~username/.ssh/authorized_keys file.

    Also, try it (for testing) first with a private key without passphrase (no need to ssh-add your key to an ssh agent)

    Finally, make sure your ssh keys are with standards names (id_rsa and id_rsa.pub), with the right protection:

    • on the local side
    • in the remote side

    Finally, an ssh -Tvvv username@hostname.com should tell you more, if the previous steps didn't solve the issue.

提交回复
热议问题