Github authenticates but doesn't allow code entry

I am the owner of the repo of the project "project", but somehow I can not click on it.

user@none ~/rails_projects/project $ git remote -v origin git@github.com:user/project.git (fetch) origin git@github.com:user/project.git (push) 

Here is the authentication:

 user@none ~/rails_projects/project $ ssh -T git@github.com Hi user/project! You've successfully authenticated, but GitHub does not provide shell access. 

Click try:

 user@none ~/rails_projects/project $ git push origin qa ERROR: The key you are authenticating with has been marked as read only. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 

Any idea how to fix this error?

+8
git github
source share
2 answers

It seems likely that you have more than one SSH key, and the key that appears is the deployment key for the repository, and not one of your account keys with write permissions. There are two ways to deal with this:

  • Remove all keys from your SSH agent and re-add only the correct account key.

     ssh-add -D ssh-add /path/to/correct/key 
  • Use HTTPS instead of SSH . You can do this by changing the remote URL for the source to use the HTTPS scheme instead of SSH.

One or the other of these should work if you just didn't provide the wrong credentials at all.

+7
source share

Mistake:

ERROR: The key you are authenticating is marked as read-only.

may mean either you:

  • you are trying to push the repo using a key associated with another repository (for example, as a deployment key), so check by:

     $ ssh -i ~/.ssh/id_rsa git@github.com Hi user/project! You've successfully authenticated, but GitHub does not provide shell access. 

    And compare user/project if it will be the same as your repository where you want to click.

  • your key is locked (for example, it has not been used for a long time), so you need to re-confirm it by performing an audit of existing ssh keys in your GitHub user profile ( /settings/ssh ),

  • you use several keys at the same time, check by: ssh-add -l (if so, delete them and add them correctly again).

So:

Please ensure that you have the correct permissions and a repository exists.

following simple steps:

  • Pay attention to your RSA fingerprint:

     $ ssh-add -l 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx (stdin) (RSA) 
  • Then check in GitHub if it has been added to your account or repository:

    • for the account, check: /settings/ssh (SSH keys),

      • if missing, add it,
      • If the key is already in use, find out which other repo it uses (see below), then delete and re-add to your account,
    • for a specific repository, check:: :name/:repo/settings/keys (Expand keys),

    • If you do not own the repository, check if you are in the correct group (with push access).

Alternatively, use and add a new key to fix common SSH problems or contact GitHub support , as they may for some reason revoke it (for example, publicly revealing it).

+4
source share

All Articles