I have a following problem:
$ git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you ha
I faced the same issue on my Ubuntu and then I realize that I am on sudo
mode, once I just access remote
without sudo
it went well.
That's how I get rid if the issue, hope it may help.
You need to do in your console (if you use an a putty ssh client):
Generate the keys, if keys not exist:
cd ~/.ssh && ssh-keygen -lf ~/.ssh/id_rsa.pub
Don't forget password, entered at this step!
Output your public key to screen:
cd ~/.ssh && cat id_rsa.pub
Copy this string by click and move a mouse pointer from begin output to end. No need to press Ctrl + V or any more keys.
Log in your account on GitHub and add this public key to https://github.com/settings/ssh
Now you can use your git locally.
Permission denied (public key). I encountered this problem today, but I found a solution finally, and successfully solved my problem.
Maybe you should verify following issues:
ssh -V username@github.com
I'd try this out from (Pushing to Git returning Error Code 403 fatal: HTTP request failed):
To definitely be able to login using https protocol, you should first set your authentication credential to the git Remote URI:
git remote set-url origin https://yourusername@github.com/user/repo.git
Then you'll be asked for a password when trying to git push.
fatal: unable to access 'https://......': The requested URL returned error: 403 if you when push your code and see this Error you follow this address in windows
⇒ Control Panel\User Accounts\Credential Manager and remove past account in GitHub
I don't think this will solve your problem since you tested ssh -vT git@github.com
directly and it worked, but you are using the ssh-agent
improperly. You need to run
$ eval `ssh-agent -s`
Agent pid 767
$ ssh-add -l
The agent has no identities.
This will evaluate the environment export commands and allow your ssh-add
and ssh
commands to communicate with the agent. Alternatively, you can ask the agent to start a shell, terminal, etc. and it will set up the proper environment:
$ ssh-agent bash
$ ssh-add -l
The agent has no identities.
In this case, the shell is running as a child of the ssh-agent
and the agent will shut down when the shell quits.