After discussing with the friendly Bitwarden’s support, I’m opening a feature request for the SSH agent in Bitwarden CLI.
Would it be possible to define a specific user when using the SSH agent with Bitwarden ?
Please consider the following example:
I have two or more accounts (personal, work, etc.), and I want to access the SSH keys in my personal account. Currently, I need to be actively connected to this account on the desktop app, as the current user, to access all my SSH keys.
However, this does not work if the user is unlocked and ‘in the background’, i.e. not selected in the desktop app.
Would it therefore be possible to access the personal account’s SSH keys in this case? Is there a way to specify the user or retrieve all SSH keys when connected (and unlocked) to multiple accounts on the desktop app?
I am in the exact same situation (personal & work accounts) and I think it would be extremely valuable being able to access SSH keys from multiple accounts without having to switch.
I’d suggest a slightly different approach than forcing account selection at the SSH agent level. Bitwarden’s SSH agent doesn’t currently support per-identity account filtering in the way you might be thinking, but there are a few workable patterns.
The cleanest method I’ve found is to use separate SSH key pairs for different identities and store them all in a single Bitwarden vault, then configure your SSH config to use specific keys for specific hosts or purposes:
Host work-servers
IdentityFile ~/.ssh/work_id_ed25519
User workuser
Host personal-servers
IdentityFile ~/.ssh/personal_id_ed25519
User personaluser
This way, SSH tries the appropriate key first, and you’re not managing multiple Bitwarden sessions. The SSH agent still sees all keys, but SSH’s config hierarchy determines which one gets used.
If you genuinely need account-level separation (perhaps for compliance or security policy), you might need to run multiple Bitwarden CLI instances or use separate SSH agent sockets with environment variable switching. That’s heavier-weight though.
What’s driving your need for multiple accounts specifically? If it’s about access control, managing the separation at the key level (different keys per identity, stored in one vault) is usually sufficient and simpler to maintain. If you’re dealing with organizational requirements around account isolation, that’s a different problem that might need a different tool or setup.