Skip to content

Commit 68a0b11

Browse files
committedMar 15, 2025··
Complete instructions with screenshots.
1 parent 04a7b6d commit 68a0b11

5 files changed

+60
-10
lines changed
 
Loading
Loading
539 KB
Loading

‎tutorials/_images/Bookmark_Panel.png

141 KB
Loading

‎tutorials/sftp_publickeyauth_bitwarden.md

+60-10
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,67 @@ Public-key authentication using Bitwarden SSH Agent allows you to connect to a r
55
- Private key managed by Bitwarden
66
- Public key placed on the server usually by the system administrator
77

8-
1. Ensure you have configured Bitwarden to manage your SSH keys. For more information, refer to [Bitwarden SSH Agent](https://bitwarden.com/help/ssh-agent/#configure-bitwarden-ssh-agent).
9-
2. Open the OpenSSH configuration file `~/.ssh/config` and add the following configuration specifying to use 1Password as the SSH agent:
10-
```
11-
Host *
12-
IdentitiesOnly yes
13-
# Bitwarden SSH agent
14-
IdentityAgent ~/.bitwarden-ssh-agent.sock
8+
1. Ensure you have configured Bitwarden to manage your SSH keys. For more information, refer to [Bitwarden SSH Agent](https://bitwarden.com/help/ssh-agent/#configure-bitwarden-ssh-agent). Open _Bitwarden → Settings…_ and select the checkbox _Enable SSH Agent_.
9+
10+
:::{image} _images/Bitwarden_SSH_Agent_Settings.png
11+
:alt: Bitwarden Settings
12+
:width: 800px
13+
:::
14+
15+
2. Create a new SSH key in Bitwarden and copy the _Public key_ to the clipboard.
16+
17+
:::{image} _images/Bitwarden_SSH_Key_Create.png
18+
:alt: Bitwarden SSH Key
19+
:width: 800px
20+
:::
21+
22+
3. Confirm the Bitwarden SSH Agent is running as expected by attempting to list available SSH keys with
23+
```
24+
SSH_AUTH_SOCK=~/.bitwarden-ssh-agent.sock ssh-add -l
25+
```
26+
27+
4. Add the public key copied from 1Password to the `authorized_keys` in your `~/.ssh` directory on the server running OpenSSH.
28+
29+
```
30+
pbpaste | ssh user@remotehost 'cat >> .ssh/authorized_keys
31+
```
32+
33+
5. Open the OpenSSH configuration file `~/.ssh/config` and add the following configuration specifying to use Bitwarden as the SSH agent:
1534
```
16-
This [configuration](https://docs.cyberduck.io/protocols/sftp/#openssh-configuration-interoperability) directive is supported by Cyberduck and Mountain Duck.
17-
5. In the [Bookmark](../cyberduck/bookmarks.md) or [Connection](../cyberduck/connection.md) panel, select *Use Public Key Authentication*
18-
6. Select the public key corresponding to your SSH private key saved in Bitwarden. Typically, it is located in the `~/.ssh` directory.
35+
Host *
36+
IdentitiesOnly yes
37+
# Bitwarden SSH agent
38+
IdentityAgent ~/.bitwarden-ssh-agent.sock
39+
```
40+
This [configuration](https://docs.cyberduck.io/protocols/sftp/#openssh-configuration-interoperability) directive is supported by Cyberduck and Mountain Duck. If you are running Bitwarden installed from the Mac App Store the socket is located in `~/Library/Containers/com.bitwarden.desktop/Data/.bitwarden-ssh-agent.sock` instead.
41+
42+
6. Add a new [Bookmark](../cyberduck/bookmarks.md) in Cyberduck or Mountain Duck. Enter the alias from your OpenSSH configuration or the hostname in _Server_. You do **not** need to set a value for _Password_.
43+
44+
:::{image} _images/Bookmark_Panel.png
45+
:alt: Bookmark Panel
46+
:width: 600px
47+
:::
48+
49+
:::{tip}
50+
The server may respond with _[Too many authentication failures](../protocols/sftp/index.md#too-many-authentication-failures)_ when trying to authenticate with all keys stored in 1Password. In the [Bookmark](../cyberduck/bookmarks.md) panel, select the public key corresponding to your SSH private key saved in 1Password for *SSH Private Key*. The public key must be available as a file you can write from the clipboard to a file using:
51+
52+
```
53+
pbpaste > ~/.ssh/test.pub
54+
```
55+
56+
Alternatively, add the public key to the OpenSSH configuration file `~/.ssh/config` with the `IdentityFile` directive
57+
58+
```
59+
# Public Key File used to filter identities from SSH agent
60+
IdentityFile ~/.ssh/test.pub
61+
```
62+
63+
7. Connect to the server and acknowledge the prompt to use the private key stored in Bitwarden.
64+
65+
:::{image} _images/Bitwarden_Confirm_SSH_Key_Usage.png
66+
:alt: Bitwarden Confirm Key Usage
67+
:width: 800px
68+
:::
1969

2070
## References
2171

0 commit comments

Comments
 (0)
Please sign in to comment.