index : bitwarden-ssh-agent.git

ascending towards madness

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)

cargo install --git https://git.holly.sh/bitwarden-ssh-agent.git

From Source (manually)

Clone the repository and build:

git clone https://git.holly.sh/bitwarden-ssh-agent.git
cd bitwarden-ssh-agent
cargo build --release

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:

  1. Create a folder to store the keys in. Name it ssh-agent.
  2. Create a new login entry, name it, and save it.
  3. Edit the entry that you just made and add your SSH private key as an attachment.
  4. Create a new entry with the following custom fields:
    • passphrase (type: hidden)
    • private (type: text)
  5. Save the entry and add your other keys (if applicable).

Notes:

If you haven't done so yet, setup the Bitwarden CLI using:

bw login

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:

bitwarden-ssh-agent

Happy logging in :)

Manual

You can build the manual (man) page for this project using [pandoc](https://pandoc.org/).

From the project root:

pandoc --standalone --to man ./doc/man/bw-ssh-agent.1.md -o ./target/bw-ssh-agent.1

To see your manual, use:

man -l ./target/bw-ssh-agent.1

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!