Using Bitwarden as an SSH agent


Besides being the coolest password manager out there, the desktop Bitwarden app also now includes an SSH agent.

This is super useful to me as I switch between multiple devices all the time over the day, and need to keep everything in sync.

Personally, I installed the desktop app through the Flatpak, but a native install will of course work as well. Just note some paths might be different.

Once it”s installed and setup, just head into the settings and enable the SSH agent. I set the “Ask for authorization” setting to “Remember until vault is locked” as I connect to a ton of servers in one session and don”t want to be annoyed by the prompt every time.

Then, on the Bitwarden side, the last thing is to create a new SSH key. Just use the “+” on the bottom and select “SSH”. Once this is done, copy the public key to GitHub, a server, or whatever you want.

Now, my recommended config on Linux is to put the following into your ~/.profile file:

export SSH_AUTH_SOCK="/home/<your user>/.var/app/com.bitwarden.desktop/data/.bitwarden-ssh-agent.sock"
Zsh

This will basically tell any program to use the Bitwarden SSH agent. Remember to log out and in again after adding the line.

Now, if you try:

ssh -T git@github.com
Zsh

Bitwarden should prompt you to allow the use of the key, and if accepted, GitHub will return:

Hi jae1911! You"ve successfully authenticated, but GitHub does not provide shell access.
Zsh

Yup, that easy overall.

Works great even on my self-hosted Vaultwarden server.


Jae's Blog
Jae's Blog
@b@b.j4.lc

Jae’s blog, now federating properly!

130 posts
42 followers
Fediverse Reactions

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

To respond on your own website, enter the URL of your response which should contain a link to this post’s permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post’s URL again. (Find out more about Webmentions.)