简体   繁体   中英

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.

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.

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 evan@evan.local (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/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM