Why Do We Need This?
In many of our teams, users, including developers, DevOps engineers, and other technical staff, require SSH access to multiple machines. Traditionally, SSH keys have been shared among users, which introduces security risks, as keys can be lost, mismanaged, or exposed. Additionally, assigning and revoking keys when team members join or leave the team is a labor-intensive task.
Possible solution we looked at –
We needed a centralized and secure approach where SSH keys are stored in a vault, rather than being distributed across individual local machines. Users are granted read-only access to the vault, allowing them to authenticate without downloading or manually managing SSH keys.
Tool We found – 1Password SSH Agent
After evaluating different solutions, we found 1Password SSH Agent to be the best fit. With this setup, users can log in seamlessly using:
ssh user@hostname
No need to download , specify or handle keys manually—the 1Password agent securely manages authentication in the background. Let's explore how this works on a windows machine
To use the 1Password SSH agent on Windows, you need to configure 1Password’s built-in SSH agent feature, which allows you to securely manage and use your SSH keys stored in 1Password. Here’s how to set up and use the 1Password SSH agent on Windows:
Steps to Use the 1Password SSH Agent on Windows:
1. Install and Set Up 1Password on Your System
- If you haven’t already installed 1Password on your Windows machine, download it from the 1Password website.
- Sign in to your 1Password account.
2. Enable SSH Agent Feature in 1Password
1Password includes an SSH agent that allows you to securely store and use SSH keys directly from your 1Password vault.
- Open the 1Password app.
- Go to Settings.
- Navigate to the Developer section.
- Toggle on the option for “Use 1Password as your SSH Agent”.
This will configure 1Password to act as an SSH agent for your system.
3. Add SSH Keys to 1Password
To use SSH keys with the 1Password agent, you’ll need to store your private SSH keys in 1Password.
- In 1Password, click + New Item and choose SSH Key from the list of options.
- Add your private SSH key (typically from a file like
id_rsa), and you can also set a label or other metadata for the key. - Save the key.
This key is now stored in your 1Password vault and will be used by the 1Password SSH agent.
4. Configure SSH to Use the 1Password Agent
Next, you need to configure your SSH client to use the 1Password SSH agent. The 1Password SSH agent runs on a named pipe that acts similarly to the ssh-agent provided by OpenSSH.
- Open your SSH configuration file:
- Path:
C:\Users\YourUsername\.ssh\config(create this file if it doesn’t exist).
- Path:
- Add the following configuration to ensure the SSH client uses the 1Password agent:
Host *
IdentityAgent \\.\pipe\openssh-ssh-agent
This configures the SSH client to use the 1Password agent for all hosts (Host * applies to all SSH connections).
5. Test SSH Authentication with 1Password
Once the 1Password SSH agent is enabled and the configuration is in place, test it by connecting to an SSH server.
For example:
ssh user@hostname
The 1Password SSH agent should now provide the stored SSH key for authentication. If you have multiple SSH keys in 1Password, the agent will offer the appropriate key for the host you’re connecting to.
6. Using 1Password CLI (Optional)
If you prefer more control or want to use 1Password’s CLI tool, you can install the 1Password command-line tool and manage SSH keys and other credentials directly from your terminal.
To install the 1Password CLI on Windows, use PowerShell:
Invoke-RestMethod -Uri https://downloads.1password.com/cli/1password-cli-win64.zip -OutFile 1password-cli-win64.zip
Expand-Archive 1password-cli-win64.zip -DestinationPath C:\op
You can then run op commands to interact with your 1Password vault. However, the built-in SSH agent in the desktop app is usually sufficient for SSH key management.
Key Features of 1Password SSH Agent:
- Automatic Key Usage: 1Password automatically offers the correct SSH key when authenticating with an SSH server, without needing manual
ssh-addcommands. - Enhanced Security: SSH keys are stored securely in your 1Password vault, protected by your master password and 2FA.
- Cross-platform: The 1Password SSH agent works across multiple operating systems, including Windows, macOS, and Linux.
Summary
By enabling the 1Password SSH agent and configuring SSH to use it via the IdentityAgent option, you can seamlessly authenticate SSH connections on Windows using the SSH keys securely stored in your 1Password vault. This allows you to centralize SSH key management and take advantage of 1Password’s security features.
