bitwarden-ssh-agent
Add SSH keys to ssh-agent using bitwarden-cli. Written in Rust.
This is a port of bitwarden-ssh-agent, which is written in Python.
Table of Contents
Getting Started
Before you begin, ensure that you have the Bitwarden CLI, the Rust toolchain, and cargo installed. If you haven't installed them yet, you can do so by following the instructions provided on the following sites:
Once you have these installed, you can proceed with setting up and running the project.
Installation
Cargo (automatic)
From Source (manually)
Clone the repository and build:
The bitwarden-ssh-agent binary will be found in the target/release directory. Run it directly from there or copy it to /usr/bin/.
Bitwarden Setup
There is some setup required in Bitwarden itself. The steps are:
- Create a folder to store the keys in. Name it
ssh-agent. - Create a new login entry, name it, and save it.
- Edit the entry that you just made and add your SSH private key as an attachment.
- Create a new entry with the following custom fields:
- passphrase (type: hidden)
- private (type: text)
- Save the entry and add your other keys (if applicable).
Notes:
- The value of the
passphrasefield is the passphrase to the private key. If there is no passphrase, you can remove the field. - The value of the
privatefield is the file name of the SSH private key that you attached. - The names of the folder and custom fields can be customized. Run
bitwarden-ssh-agent -hor consult the manual for more information.
If you haven't done so yet, setup the Bitwarden CLI using:
and follow the instructions to set your BW_SESSION environment variable or add it to your shell.
Usage
If all of the above requirements are satisfied, register your keys with:
Happy logging in :)
Manual
You can build the manual (man) page for this project using [pandoc](https://pandoc.org/).
From the project root:
To see your manual, use:
To install the manual to the system, consult your distribution's owners manual and place it in the man1 directory. On my machine, that is /usr/share/man/man1/.
Contributing
Patches are welcome via git-send-email.
License
bitwarden-ssh-agent is licensed under the AGPL 3.0.
Troubleshooting
Stuck in a login loop
Symptom:
Attempting to login fails because of a login loop. This means that your BW_SESSION has expired.
Solution:
Run bw logout and then bw login and get a new BW_SESSION token.
I use Windows
I can't help, sorry!