Bitwarden Password Manager desktop app can act as an SSH Agent to securely encrypt and store your SSH (Secure Shell) keys for use with:
Authenticating to servers
Signing Git commits
Interacting with SSH-based services
See About SSH for additional information on how the agent works, supported key types, known limitations, and vault behavior.
Enable SSH Agent
To enable the SSH Agent on your Bitwarden desktop app, navigate to Settings and Enable SSH agent. Then, adjust the Ask for authorization when using SSH agent setting. This setting will determine when Bitwarden will require you to authorize access to an SSH key:
Enable SSH storage on desktop client
Behavior by vault state
The SSH agent behaves differently depending on the current state of your vault. The following describes single-account behavior with the agent enabled.
Vault state
Agent running
List requests
Sign requests
Logged out
No
Locked (before initial unlock)
Yes
Supported
Prompts to unlock vault.
Locked (after initial unlock)
Yes
Supported
Prompts to unlock vault, then prompts to authorize.
Unlocked
Yes
Supported
Supported
Configure your system to use Bitwarden SSH agent
In order to use Bitwarden as your primary SSH Agent, you will be required to configure your SSH client to communicate with Bitwarden for authentication. Once you have enabled the agent in the desktop app, configure your operating system to route SSH requests to Bitwarden:
To enable the Bitwarden SSH Agent on Windows, you must disable the OpenSSH service on your Windows machine:
Navigate to Services → OpenSSH Authentication Agent.
Windows Services panel
Once you have opened the OpenSSH Authentication Agent Properties window, set the Startup type setting to Disabled.
Windows Services panel
Once the settings have been adjusted, select Apply and then OK.
Enable the Bitwarden SSH Agent on macOS store download:
Configure the SSH_AUTH_SOCK variable to point to the Bitwarden SSH Agent socket. In the following example, replace <user> with your username:
To make this persistent, add the export command to your ~/.zhrc or ~/.bashrc file.
Enable the Bitwarden SSH Agent on snap or Flatpak installations:
Configure the SSH_AUTH_SOCK variable to point to the Bitwarden SSH Agent socket. The following example demonstrates how to do this after replacing <user> with your username:
Once the SSH Agent has been configured for Bitwarden, you may test the setup by requesting an SSH list:
Plain Text
ssh-add -L
Scenarios and workflows
Once the agent has been enabled and your OS has been configured, you can use Bitwarden SSH keys in a range of tools and workflows. The following scenarios will provide step-by-step setup for a range of common setups and use cases.
SSH can be used to authenticate with Git. The Bitwarden SSH Agent can add security and ease of use to your Git workflows. In this example, the Bitwarden SSH Agent will authenticate to GitHub.
On your GitHub account, setup an SSH key by navigating to Settings, SSH and GPG keys, then select New SSH Key.
On the add new SSH key screen, add a Name, select a Key type. Choose Authentication Key. Copy & paste the Public key from your Bitwarden vault into the Key field on GitHub.
Create new GitHub key
Once you have completed all of the fields, select Add SSH key to save the key. GitHub will request that you verify your GitHub account before the key is saved.
Test the GitHub SSH key in your terminal, for example if you are using macOS:
Plain Text
ssh -T git@github.com
If successful, Bitwarden will prompt you to verify the access request. Select Authorize to confirm. If successful, you will receive a message verifying the authentication attempt:
Plain Text
Hi <USER>! You've successfully authenticated, but GitHub does not provide shell access.
Use the Bitwarden SSH Agent to sign SSH Git commits. Before using the Bitwarden SSH Agent to sign Git commits, your system will require:
Git version 2.34 or newer. Check your Git version with:
Plain Text
git --version
OpenSSH version 8.8 or newer. Check version with:
Plain Text
ssh -V
Bitwarden desktop client with SSH Agent enabled.
Configure your Git environment to point to your SSH key for signing. To complete this you may set global variables or establish the instructions in your .gitconfig file.
Set global variables
To configure Git settings using --global variables:
Set Git to use SSH for signing:
Plain Text
git config --global gpg.format ssh
Specify the SSH key to use as the signing key. To use the Bitwarden SSH Agent, replace <YOUR_PUBLIC_KEY> with the public key copied from the SSH key saved in your Bitwarden vault.
Using SSH to authenticate with Git can add security and ease of use to your workflow. Similarly, SSH keys stored in Bitwarden can be used to sign and verify Git commits using SSH protocol. In this example, the Bitwarden SSH Agent will be used to sign Git commits to GitHub.
On your GitHub account, setup an SSH signing key by navigating to Settings, SSH and GPG keys, then select New SSH Key.
On the add new SSH key screen, add a Name and select a Key type, Choose Signing Key. Copy & paste the Public key from your Bitwarden vault into the Key field on GitHub.
Configure git to use the allowedSignersFile with the following command:
# Create allowed_signers file
touch ~/.ssh/allowed_signers
# Edit the allowed_signers file and add a line for your public key pair you wish to trust, for example:
User1@Bitwarden.com ssh-ed25519 <Your_Public_Key>
Use the SSH key to clone your repository with SSH method:
SSH clone
Plain Text
git clone git@github.com:<USER>/<repository>.git
Create the Git commit using terminal or your preferred text editor:
Plain Text
git commit -m "This commit is signed using SSH"
Bitwarden will prompt you to authorize the key usage based on user settings:
Authorize SSH with client
Once authorized, the SSH key will be initiated to approve the commit. You may now push the commit:
Plain Text
git push
You may verify your commit on Github by navigating to GitHub commits:
Verify your commit in GitHub
SSH agent forwarding allows a remote server you are accessing to authenticate to other servers using your keys, without exposing your private keys outside of your vault. The server you are logged in to can request your local Bitwarden instance to authenticate to the remote server. In this example, we will demonstrate transferring files between servers:
Create a new SSH key or import an existing SSH key to your Bitwarden desktop app.
Activate agent forwarding by opening a connection with the server you wish to send files to: