Question

i how can i solve this error "Permission denied (publickey)." when i typed "git push live master" ???

i try to deploy my project on digitalocean hosting , i follow this link , http://www.refactoru.com/blog/setting-up-push-to-deploy-on-digitalocean every thing is ok , but when i typed "git push live master " on git bash on my local repo i get error $ git push live master Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. i searched for this problem and tried many solution but it didnot work, notes : i work on windows OS , so i can connect to ubuntu digitalocean server with putty without any problem … i know the problem related with authentication , but i don’t know how i solve it ??? plz help me… thanks


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

thanks a lot xMudrii for your response , but can you tell me if my thinking is correct or not : when i added live brunch i gave it the path on the Ubuntu hosting server like this : git remote add live root@x.x.x.x:/opt/adviser.git where x.x.x.x is Ubuntu hosting server IP Address so when i typed git remote -v i get : live root@x.x.x.x:/opt/adviser.git (fetch) live root@x.x.x.x:/opt/adviser.git (push) origin https://github.com/myname/adviser.git (fetch) origin https://github.com/myname/adviser.git (push) is that correct , i add remote brunch with my hosting server path depend on this link https://www.digitalocean.com/community/tutorials/how-to-set-up-automatic-deployment-with-git-with-a-vps please help , i need any idea that help me …

Make sure you set remote location correctly. What does Git service you use? Is it GitHub or something other? To check did you set remote location correctly, execute git remote -v in project directory (in same directory you did git push live master).

  1. git remote -v

If you use GitHub, output should be like one of this two:

Example output 1 - Remote listing - Git
live  	https://github.com/your-github-username/repo-name (fetch)
live  	https://github.com/your-github-username/repo-name (push)
Example output 2 - Remote listing - Git
live  	git@github.com:your-github-username/repo-name (fetch)
live  	git@github.com:your-github-username/repo-name (push)

In case of first output, you should be asked for username and password once you try push. For second, make sure you have set up SSH keys correctly. If you don’t have SSH key, you can follow GitHub guide to do so. If you use GitHub and don’t match above pattern, you made some mistake. Also, once again, make sure you typed your username and repo name correctly.

For The access Denied Issues And git username , password

I had this problem too but managed to solve it, the error is that ur computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution For Windows you can find the keys here:

control panel > user accounts > credential manager > Windows credentials > Generic credentials

Next remove the Github keys.