ssh-add
The ssh-key
resource sets up and manages the command ssh-add
which is responsible
for loading SSH keys into the ssh-agent. For more information, visit the
man pages for ssh-add.
Parameters:
-
path: (string, required) The path to the SSH key to add.
-
appleUseKeychain: (boolean) Corresponds to the
--apple-use-keychain
parameter. Controls whether the key should be loaded into the Apple keychain. Only keys with a passphrase can be loaded.
Example usage:
The above example will add the id_ed25519
key to the ssh-agent using ssh-add
if it hasn’t been added already. It is configured to use the user’s Apple Keychain
so it won’t need to prompt the user for their passphrase again going forward.
For a full example, visit the recipes page to see a full set up of SSH for github access