John Halsey
John Halsey

Reputation: 2008

Cannot git sync after macOS Sierra update

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.

Upvotes: 6

Views: 1928

Answers (3)

Agu Dondo
Agu Dondo

Reputation: 13579

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.

Upvotes: 6

Evan Pon
Evan Pon

Reputation: 1506

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/

Upvotes: 2

Verloren
Verloren

Reputation: 949

Sierra update for whatever reasons deletes all your SSH keys (as it did for me). This guide should be enough to generate a new key and link it to your account.

Upvotes: 0

Related Questions