Github Password and Personal access token not working

127 Views Asked by At

I am trying to access my private github repository in terminal (on macOS version 12.5), but its not working for some reason.

First, I type in git clone https://github.com/myorganization/myrepository.git

Then im prompted with:

(gnome-ssh-askpass:17485): Gtk-WARNING **: 15:18:11.061: cannot open display: 
error: unable to read askpass response from '/usr/libexec/openssh/gnome-ssh-askpass'
Username for 'https://github.com':

I type in my username and hit enter, then i get this message:

(gnome-ssh-askpass:17492): Gtk-WARNING **: 15:18:18.607: cannot open display: 
error: unable to read askpass response from '/usr/libexec/openssh/gnome-ssh-askpass'
Password for 'https://[email protected]': 

Now here's where my error is. I have tried using my personal access token and also tried using the password for my github account, and no matter what I get this error:

fatal: unable to access 'https://github.com/myorganization/myrepository.git/': The requested URL returned error: 403

It may also be worth noting that when I type in my password, nothing shows up on the terminal, but im pretty sure that thats just for security purposes.

Does anyone know how to fix this?

1

There are 1 best solutions below

0
Tommi On

I ran into the same issue, it seems you havent given the token the correct permissions. Go to your token located at github > profile > settings > developer settings > personal access tokens then click on the token you are using and edit it. If you use fine grained access token you can add more refined access, i added read-only to the "contents permission" and that did the trick of cloning the repo, havent tried commits yet but the permission covers that so it should work.

If you have a access token classic (second choice in the dropdown when you generate access tokens) you only need to select the repo scope and you are set! So Im thinking of using the classic ones for my personal projects as it seems smoother.

Hope this helps!