Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
4 years agoSSH Agent Forwarding
I'm really enjoying using 1Password as a ssh-agent with biometric unlock. I'm wondering if it's possible forward the SSH agent though.
Scenario:
I have two macs with 1Password setup with biomet...
Michael_Mercuri
4 years agoFrequent Contributor
This seems to work for me.
Instead of configuring 1Password's SSH Agent via ~/.ssh/config
, I instead rely on the environment variable SSH_AUTH_SOCK
. In my ~/.zshrc
I do this:
```
Set SSH_AUTH_SOCK to use 1Password as SSH Agent when not ssh'd in remotely.
if [ -z $SSH_TTY ] ; then
SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock
fi
```
This gives me the behavior I'm looking for: when I'm working on my Mac locally (SSH_TTY
is not set), the local instance of 1Password is used. When I'm ssh'd into my Mac remotely, the forwarded agent is used (I have ForwardAgent yes
in my ~/.ssh/config
as indicated in my previous post. This allows me to always use the 1Password instance running on my local Mac, even when ssh'd into another host remotely and that host may also be running 1Password.
I'm curious if there are other ways to accomplish this.
Cheers,
Michael
Update: oops. I had the logic reversed in my original post. fixed.