原文链接 On OSX, the native ssh-add client has a special argument to save the private key's passphrase in the OSX keychain, which means that your normal login will unlock it for use with ssh. On OSX Sierra and later, you also need to configure SSH to always use the keychain (see Step 2 below). Alternatively you can use a key without a passphrase, but if you prefer the security that's certainly acceptable with this workflow. Step 1 - Store the key in the keychain Just do this once: ssh-add -K ~/.ssh/[your-private-key] Enter your key passphrase, and you won't be asked for it again. (If you're on a pre-Sierra version of OSX, you're done, Step 2 is not required.) Step 2 - Configure SSH to always use the keychain It seems that OSX Sierra removed the convenient behavior of persisting your keys between logins, and the update to ssh no longer uses the keychain by default. Because of this, you will get prompted to enter the passphrase for a key after you upgrade, and again a...