# 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:

```shell
 brew install --cask bitwarden
```

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

```shell
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:

```shell
 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.

![](https://cdn.hashnode.com/uploads/covers/6392045c0771b6e5cf4a8714/0b01e8fd-0797-40d5-91ee-6c8e643c4ddd.png align="center")
