SSH Key - Still asking for password and passphrase

后端 未结 30 1362
孤街浪徒
孤街浪徒 2020-11-27 08:35

I\'ve been somewhat \'putting up\' with Github always asking for my username and password when I clone a repository. I want to bypass this step because it is an annoyance w

相关标签:
30条回答
  • 2020-11-27 09:23

    Mobaxterme had a UI interface for it

    setting > configuration > SSH > SSH Agent > [check] Use internal SSH agent "moboAgent" > add [your id_rsa and restart mobaxterme to set changes]

    0 讨论(0)
  • 2020-11-27 09:23

    Adding to the above answers. Had to do one more step on Windows for git to be able to use ssh-agent.

    Had to run the following command in powershell to update the environment variable:

    PS> [Environment]::SetEnvironmentVariable("GIT_SSH", "$((Get-Command ssh).Source)", [System.EnvironmentVariableTarget]::User)

    Restart VSCode, Powershell or whatever terminal you are using to activate the env variable.

    Complete instructions can be found [here] (https://snowdrift.tech/cli/ssh/git/tutorials/2019/01/31/using-ssh-agent-git-windows.html).

    0 讨论(0)
  • 2020-11-27 09:25

    Use ssh remote url provided by Github not https.

    0 讨论(0)
  • 2020-11-27 09:26

    If you used for your GIT the password authentication before, but now are using SSH authentication, you need to switch remote URLs from HTTPS to SSH:

    git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
    
    0 讨论(0)
  • 2020-11-27 09:28

    Just run the following command:

    ssh-add -K
    

    It will never ask you to enter the password again.

    0 讨论(0)
  • 2020-11-27 09:29

    I already had set a passphrase but for some reason it wouldn't recognize it anymore. So I just added the identity file to my keychain again using ssh-add -K and it stopped asking for my password.

    0 讨论(0)
提交回复
热议问题