# Personal Programming Notes

## To err is human; to debug, divine.

Recipes with ssh-add command.

### OSX specific

On OS X ssh-add is integrated with the system keychain. If you give the -K option, as in ssh-add -K, when you add a key, that key’s password will be added to the keychain. As long as your keychain is unlocked, a key that has been stored in this way doesn’t require a password to be loaded into the agent.

All keys with their password stored in the keychain will automatically be loaded when you run ssh -A. This happens automatically on login.

When a password has been stored in keychain, ssh -K -d key-file both removes the key from the agent and removes it password from the keychain. Without -K, -d does not change the keychain and the key can be reloaded without a password. -D silently ignores -K.

### Recipe: Connecting without a passphrase

ssh-add is commonly used to simplify ssh command. In the following example, you need to specify a private key file in some location.

By adding the private key to the authentication agent with ssh-add, you can simplify the ssh command as follows: