Skip to main content

Command Palette

Search for a command to run...

setting up Bitwarden SSH Agent for VS Code on MAC OS

Published
1 min read
setting up Bitwarden SSH Agent for VS Code on MAC OS

Recently I switched over from Roboform to Bitwarden as my passwordvault. The main advantages why I did this:

  • I use a vaultwarden docker image on my DS420j NAS

  • Vaultwarden is completely free

  • I can use the standard Bitwarden clients (Desktop and Browser extensions)

  • I can share my passwords between all my laptops (Mac OS, Linux and Windows)

  • It has an integrated SSH agent, so I can use my SSH keys throughout my development stack on all my devices

Very important, make sure (on Mac OS) to use brew to install Bitwarden:

 brew install --cask bitwarden

then make sure that your environment is set correctly (I did it in my "~/.zshrc" file:

export SSH_AUTH_SOCK=~/.bitwarden-ssh-agent.sock

Finally, make sure that the MacOS environment is properly configured for VS Code to pick up the setting:

 launchctl setenv SSH_AUTH_SOCK "$SSH_AUTH_SOCK"

Now, when I open a git repo from gitlab, github or whatever git server, VS Code tries to open the SSH Agent and my Bitwarden desktop client asks me to authorize the request; Brilliant.

setting up Bitwarden SSH Agent for VS Code on MAC OS