Forum Discussion

jpanderson-keldin's avatar
1 day ago

SSH Agent Forwarding to Remote Mac

Okay! I have a Mac Mini that I use as a home server (it was effectively free after trade ins of old stuff). I do have 1Password and its SSH agent running there for when i'm using it with a screen attached, but I'd like to be able to initiate 1Password requests when SSH'ed into the box as well so i can perform `git` operations in particular.

I have tried https://developer.1password.com/docs/ssh/agent/forwarding/#remote-workstation and to an extent it works.

ssh -A my_name@macmini.local

cat ~/.ssh/config
# Output, showing we are trying to force using SSH_AUTH_SOCK
# Match host * exec "test -z $SSH_TTY"
#         IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"

echo $SSH_AUTH_SOCK
# /Users/my_name/.ssh/agent/s.czyqavwOqO.sshd.RviXimjiEr

So I can see that I'm getting some kind of agent socket attached appropriately. I've configured the `.ssh/config` to not use the IdentityAgent when over SSH (it's not commented out in the actual file, just commented here for display purposes in the code block).

However, when trying to run a git command, it's like SSH doesn't even try to use the auth socket for pulling data and `ssh-add -l` is equally unhelpful.

ssh-add -l
# The agent has no identities.

git pull
# git@github.com: Permission denied (publickey).
# fatal: Could not read from remote repository.

# Please make sure you have the correct access rights
# and the repository exists.

I am sure I'm just missing a configuration of some kind somewhere but I am at a loss for what it could be. Happy to provide other debug information from either the host or the remote Mac mini as needed.

No RepliesBe the first to reply