How do you keep SourceTree/SSH from forgetting your SSH keys? (I have to manually re-run 'ssh-add' to get it to work again!)

后端 未结 3 1084
予麋鹿
予麋鹿 2020-12-25 08:49

UPDATE - It happened AGAIN!!!

Ok, so this just happened AGAIN! MAN is this frustrating!!! But this time I dug a little deeper and found that for some re

3条回答
  •  借酒劲吻你
    2020-12-25 09:12

    First, install the latest Git for Windows release (the 2.15.1.2 one, by simply uncompressing the archive PortableGit-2.15.1.2-64-bit.7z.exe anywhere you want, and adding it to your PATH)

    Second, make sure your SourceTree is using the System Git

    Third, test in command-line if your ssh key is recognized:

    ssh -T git@github.com
    
    Hi username! You've successfully authenticated, 
    but GitHub does not provide shell access.
    

    Finally, make sure that SourceTree / Tools / Option uses as SSH client the OpenSSH one (not putty)

    Then SourceTree should have nop problem reusing your ssh key.


    From your logs, the ~/.ssh/config generate is wrong: it mentions as User your username.
    Whenever you establish an SSH connection to github.com/bitbucket.org, it is never as "you". It is always as git.

    Host MarqueIV-Bitbucket
        HostName bitbucket.org
        User MarqueIV
        PreferredAuthentications publickey
        IdentityFile /Users/MarqueIV/.ssh/MarqueIV-Bitbucket
        UseKeychain yes
        AddKeysToAgent yes
    

    Test it with ssh -Tv MarqueIV-Bitbucket

提交回复
热议问题