Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot git sync after macOS Sierra update

Tags:

git

github

After updating to macOS Sierra 10.12 I am no longer able to sync up to gutHub. From the desktop software I get

You may not have permission to access [project]. Check Preferences to make sure you’re still logged in.

I am have checked and am logged in, and definitely have permission to the repo.

On the command line I get

Permission denied (publickey). fatal: Could not read from remote repository.

like image 343
John Halsey Avatar asked Sep 27 '16 09:09

John Halsey


2 Answers

I had this issue. It turns out Sierra removed my SSH identity from the agent. I had to add it again from the terminal with:

ssh-add ~/.ssh/id_rsa

Then the Github app started syncing again.

like image 73
Agu Dondo Avatar answered Nov 09 '22 16:11

Agu Dondo


It's possible you have an old DSA key. Sierra is using a new version of OpenSSH (OpenSSH_7.2p2 on my machine), which has deprecated DSA keys. See http://www.openssh.com/legacy.html.

In order to check: ssh-keygen -lf name_of_your_public_key

If you see something that looks like 1024 SHA256:T3YARI7ecqmQofK/yPyt6+yISTK9Z2ks3si3kp1acvM [email protected] (DSA), you have a 1024-bit DSA key that will not work on Sierra.

You'll need to generate a new key. Lots of articles on this on the web - a recent one sparked by the Sierra upgrade: https://medium.freecodecamp.com/upgrading-to-macos-sierra-will-break-your-ssh-keys-and-lock-you-out-of-your-own-servers-f413ac96139a.

Once you have your new key, you'll need to upload it to GitHub (assuming guthub was a typo). Current steps for that are here: https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

like image 2
Evan Pon Avatar answered Nov 09 '22 17:11

Evan Pon