Level up your business security with free, on-demand training and certification. Explore 1Password Academy today →
Forum Discussion
olilaban
2 months agoNew Contributor
SSH Agent forwarded to Docker container only attempts to use the first SSH key
I have the SSH agent forwarded into a Docker container with the following config: volumes:
- '~/.ssh:/.ssh:ro'
- '~/.ssh/known_hosts:/.ssh/known_hosts:rw'
- '${SSH_AUTH_SOCK_HOST:-/run/...
Michael_Mercuri
2 months agoDedicated Contributor
I believe with the default configuration, 1Password SSH Agent prompts for a key when the key is requested (like any other SSH Agent). If you want a specific key, you'll need to specify the key, either in the ~/.ssh/config file or via the command line ("ssh -i identity_file").
What I find works best with 1Password SSH Agent, is to store the PUBLIC keys as identify files (e.g. "~/.ssh/config/id_ed25519.pub") and then in ~/.ssh/config set the identity file to the public key via "IdentityFile ~/.ssh/id_ed25519.pub".
This has two advantages:
- no need to store the private key on disk
- easy to configure specific key to use
If you really want to configure 1Password SSH Agent to only allow access to specific keys, it's possible to configure it via 1Password https://developer.1password.com/docs/ssh/agent/config.
However, I find it best to stick with basic SSH config for broader compatibility.