Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github Mac Permission Issue

Tags:

I'm using the latest Github for Mac as a new Git user. When I try to sync a repo (that I first cloned, then created a new branch, commited changes, and then merged with master), I got the error:

Authentication Failed.  You may not have permission to access repo111. Check Preferences to make sure you’re still logged in. 

I searched for similar questions, but the answer seemed to be add SSH keys to github, so I followed: https://help.github.com/articles/generating-ssh-keys.

When I do ssh -T [email protected], I get:

Hi User111! You've successfully authenticated, but GitHub does not provide shell access. 

I'm logged in as the correct user, and have rights to the repo, so I'm not sure why I'm not authenticated?

like image 275
Muhambi Avatar asked Jul 30 '14 21:07

Muhambi


People also ask

How do I fix Permission denied in GitHub?

Always use the "git" user$ ssh -T [email protected] > Permission denied (publickey). If your connection failed and you're using a remote URL with your GitHub username, you can change the remote URL to use the "git" user. You should verify your connection by typing: $ ssh -T [email protected] > Hi username!

How do I fix permission denied error on Mac?

Change file permissions Type this command followed by a space: chmod 755. Drag the file or folder onto the Terminal window. Press Return. Permissions for the file or folder will be changed to read, write, and execute.

Is GitHub compatible with Mac?

You can install GitHub Desktop on supported Windows or macOS operating systems.


2 Answers

It could be that you entered a password incorrectly and it's stored in your keychain.

For my situation, I was using GitHub for Mac to work with a BitBucket repository. Long story short, I mistyped my BitBucket password and GitHub for Mac could not authenticate (because the password stored in my keychain was wrong).

Thanks to the helpful folks at GitHub, they quickly responded when I asked for help:

Open Keychain Access.app (in /Applications/Utilities) and search for "GitHub for Mac." There should be an entry like "GitHub for Mac — bitbucket.com". Delete that entry


Steps to fix if using GitHub for Mac to manage a BitBucket repo

If you see this:

enter image description here

… then you might have a BitBucket keychain/password problem.

Open Keychain Access.app (in /Applications/Utilities) and search for bitbucket:

enter image description here

Right-click on the entry and get info:

enter image description here

Click on "Access Control" to confirm that it's truly the GitHub for Mac BitBucket password/login keychain item:

enter image description here

Rather than deleting the keychain entry/item, I just edited my password:

enter image description here

You should now be able to use GitHub for Mac without authentication failures. :)

like image 120
mhulse Avatar answered Oct 13 '22 20:10

mhulse


Had the same problem, but it was not a password problem, since other repositories worked just fine.

Finally compared .git/config with a working repository and found this:

This failed:

[remote "origin"]   url = [email protected]/path/to/repository 

This worked:

[remote "origin"]   url = https://github.com/path/to/repository 

Still have no idea how or why this changed.

like image 29
Nik Avatar answered Oct 13 '22 20:10

Nik