SSH Private Key Permissions using Git GUI or ssh-keygen are too open

前端 未结 25 1848
说谎
说谎 2020-12-07 06:57

Recently I\'ve been unable to clone or push to github, and I\'m trying to find the root cause.

This is on windows

I have cygwin + git as well as msy

25条回答
  •  旧时难觅i
    2020-12-07 07:38

    Unless there is a reason that you want to keep that private/public key pair (id_rsa/id_rsa.pub), or enjoy banging your head on the wall, I'd recommend just recreating them and updating your public key on github.

    Start by making a backup copy of your ~/.ssh directory.

    Enter the following and respond "y" to whether you want to over write the existing files.

    ssh-keygen -t rsa
    

    Copy the contents of the public key to your clipboard. (Below is how you should do it on a Mac).

    cat ~/.ssh/id_rsa.pub | pbcopy
    

    Go to your account on github and add this key.

    Name: My new public key
    Key: 
    

    Exit from your terminal and restart a new one.

    If you get senseless error messages like "Enter your password" for your public key when you never entered one, consider this start over technique. As you see above, it's not complicated.

提交回复
热议问题