git: osxkeychain credential helper silently fails to remember username/password

后端 未结 1 1401
陌清茗
陌清茗 2021-02-05 15:22

This page and many like it gives instructions for setting up the osxkeychain credential helper with git. I\'ve followed these instructions; everything seemed to work fine. I can

相关标签:
1条回答
  • 2021-02-05 15:56

    Edit ~/.ssh/config and add UseKeychain yes to every host you want the Keychain to remember the password for.

    For example, if you are trying to do this for GitHub:

    Host github.com
        IdentityFile ~/.ssh/your_github_cert_rsa
        UseKeychain yes
    

    If you want to enable it for every host, just add:

    Host *
        UseKeychain yes
    

    This is a new requirement, added by Apple on macOS Sierra 10.12.2, you can learn more about it running man ssh_config in 10.12.2:

    UseKeychain
    
                 On macOS, specifies whether the system should search for
                 passphrases in the user's keychain when attempting to use a par-
                 ticular key. When the passphrase is provided by the user, this
                 option also specifies whether the passphrase should be stored
                 into the keychain once it has been verified to be correct.  The
                 argument must be ``yes'' or ``no''.  The default is ``no''.
    

    Under Mac OS 10.11, you can check if the keychain is disabled with the variable

    KeychainIntegration
      Specifies whether to enable Keychain support on Mac OS X.  
      If Keychain support is enabled, then passwords for identities can be 
      managed via the Mac OS X Keychain.
      The value for this keyword must be ``yes'' or ``no''.  The default is ``yes''.
    AskPassGUI
      Show the system password prompt
    
    0 讨论(0)
提交回复
热议问题