2020-03-07 17:22:01 +00:00
# Bitwarden SSH Agent
## Requirements
2020-04-13 10:51:37 +01:00
* You need to have the [Bitwarden CLI tool ](https://github.com/bitwarden/cli ) installed and available in the `$PATH` as `bw` .
* `ssh-agent` must be running in the current session.
2020-03-07 17:22:01 +00:00
2020-04-13 10:51:37 +01:00
## What does it do?
Fetches SSH keys stored in Bitwarden vault and adds them to `ssh-agent` .
2020-03-07 17:22:01 +00:00
## How to use it
2020-04-13 10:51:37 +01:00
1. Run,
```shell
./bw_add_sshkeys.py
```
2. Enter your Bitwarden credentials, if a Bitwarden vault session is not already set.
2022-04-27 11:26:14 +01:00
3. (optional) Enter your SSH keys' passphrases if they're not stored in your Bitwarden.
2020-03-07 17:22:01 +00:00
## Storing the keys in BitWarden
2020-04-13 10:51:37 +01:00
1. Create a folder called `ssh-agent` (can be overridden on the command line).
2. Add an new secure note to that folder.
3. Upload the private key as an attachment.
4. Add the custom field `private` (can be overridden on the command line), containing the file name of the private key attachment.
2022-04-27 11:26:14 +01:00
5. (optional) If your key is encrypted with passphrase and you want it to decrypt automatically, save passphrase into custom field `passphrase` (field name can be overriden on the command line)
2022-04-25 16:32:24 +01:00
6. Repeat steps 2-6 for each subsequent key