1

I have two github account and when I try to clone and push, for some reason it fails with permission denied.

I have configured my ssh keys and I can verify that ssh works with

ssh -vvv git@github.com


git push -u origin

remote: Permission to <user-name-2>/test-config.git denied to <user-name-1>.
fatal: unable to access 'https://github.com/<user-name-2>/test-config.git/': The requested URL returned error: 403
Rajesh Jain
  • 1,159
  • 3
  • 19
  • 37

2 Answers2

0

You're attempting to push to a repository you are not allowed to push to. Check whether you have filesystem permissions on the server. If you're really trying to push to another users account on GitHub, afaik this is not allowed.

You must use the key of the other user. The following two Stack Overflow questions have answers about how to do something like this:

jotik
  • 17,044
  • 13
  • 58
  • 123
0

I got the answer to my question from this thread Pushing to Git returning Error Code 403 fatal: HTTP request failed

git remote set-url origin https://yourusername@github.com/user/repo.git
Community
  • 1
  • 1
Rajesh Jain
  • 1,159
  • 3
  • 19
  • 37