Signing back into the Community for the first time? You'll need to reset your password to access your account. Find out more.
Forum Discussion
PurplProto
3 years agoOccasional Contributor
I can't get 1Pass ssh-agent working at all on Windows
I tried following the SSH doc linked on the blog post for this update, but I can't get it working at all 😣.
For the prerequisite requirements:
I was previously on the beta channel, before running the uninstaller and reinstalling from the prod release on the downloads page, this didn't change anything though.
Yes, I'm running 1Password 8 (click to expand)
I have the OpenSSH Client installed (_click to expand_)
For step 1:
I opted to import my existing keys (_click to expand_)
Step 2:
I skipped, as I already have my key there.
Step 3:
I already had OpenSSH installed (not sure how or when, but it's there) and it was also already disabled (_click to expand_)
I've enabled the SSH settings options in the 1Password app (_click to expand_)
Step 4:
Configured the agent
In Gitbash (click to expand)
In PowerShell (_click to expand_)
Step 5
Failure across the board. No Git actions or SSH actions work.
Just to prove the key is on my account, it's the same key I've used for well over a year 😄 (click to expand)
Debug time!
The GitHub key check, but verbose (_click to expand_)
> PS C:\Users\PurplProto> ssh -vT git@github.com > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 > debug1: Reading configuration data C:\\Users\\PurplProto/.ssh/config > debug1: C:\\Users\\PurplProto/.ssh/config line 1: Applying options for * > debug1: Connecting to github.com [140.82.121.3] port 22. > debug1: Connection established. > debug1: identity file C:\\Users\\PurplProto/.ssh/id_rsa type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_rsa-cert type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_dsa type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_dsa-cert type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_ecdsa type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_ecdsa-cert type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_ed25519 type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_ed25519-cert type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_xmss type -1 > debug1: identity file C:\\Users\\PurplProto/.ssh/id_xmss-cert type -1 > debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1 > debug1: Remote protocol version 2.0, remote software version babeld-4f04c79d > debug1: no match: babeld-4f04c79d > debug1: Authenticating to github.com:22 as 'git' > debug1: SSH2_MSG_KEXINIT sent > debug1: SSH2_MSG_KEXINIT received > debug1: kex: algorithm: curve25519-sha256 > debug1: kex: host key algorithm: ecdsa-sha2-nistp256 > debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC:Check if the pipe even exists (spoiler, apparently it doesn't) (click to expand)
> PS C:\Users\PurplProto> (get-childitem \\.\pipe\openssh-ssh-agent).FullName > get-childitem : Cannot find path '\\.\pipe\openssh-ssh-agent' because it does not exist. > At line:1 char:2 > + (get-childitem \\.\pipe\openssh-ssh-agent).FullName > + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + CategoryInfo : ObjectNotFound: (\\.\pipe\openssh-ssh-agent:String) [Get-ChildItem], ItemNotFoundException > + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommandThen searching the logs folder for "ssh" seems to only yield the agent starting message. I've never seen an auth prompted as described in the blog post at all 😥 (_click to expand_)
And yes, I've tried turning it off and on again, both the SSH options in 1Password and my PC. 😁
It's like the 1Pass ssh-agent doesn't exist at all 🙁 What's going wrong here?
1Password Version: 8.6.0
Extension Version: 2.3.0
OS Version: Windows 10 21H2
- PurplProtoOccasional Contributor
I've tried this again since I got it working on my laptop right away after I did a much needed format on there. I have successfully been able to get this working on my desktop now as well where I was having the previous issues.
I believe what the issue seems to be was I'd been using
ssh -Tv git@github.com
in GitBash which was always failing. It seems 1Password's agent doesn't work with GitBash's ssh binary directly, which now also seems obvious to me after remembering one of the install steps is to set the sshCommand in the Git config to that of the Windows binary, so running the SSH test for GitHub here will naturally fail. I've repeated this same test in CMD so it's using Windows OpenSSH instead and that works, I can even access my servers from there too, yay! 🎉I would certainly like to get this working in GitBash though as I prefer to use bash-like tools over Windows' equivalents. I think for this, setting the Windows' OpenSSH in the path environment variable before GitBash's SSH binary should do the trick for now, but maybe finding a way to add the
\\.\pipe\openssh-ssh-agent
to GitBash's environment would be nicer. I'm not well versed with pipes, but I've read someone had success usingsocat
, though it looked like a rather over-complicated solution to the issue, so I won't bother trying that.TL;DR
I was testing if 1Password's agent was working using SSH inside GitBash, though 1Password's agent only works with Windows' OpenSSH. The only way this works for Git inside GitBash is because an install step added a config option to Git to instruct it to use Windows' OpenSSH instead. - KitforbesOccasional Contributor
Just to follow up that this eventually did start to work. All I can assume is that it was fixed by "turning it off and on again".
- KitforbesOccasional Contributor
I've got the same issue as PurplProto. I'll run through all of the debug steps tomorrow and follow up if I get a different result.
- PurplProtoOccasional Contributor
@subzero2000 They are all in my private vault, I don't have a "personal" vault. I only have 3 vaults, "private", "shared", and "work". work is the only vault I created.
- PurplProtoOccasional Contributor
floris_1P Sorry for the delayed reply, been busy with work.
I used
tail
inside Gitbash on the current log file, disabling and then enabling does print a single line saying the agent has started
INFO 2022-04-06T11:05:12.662 tokio-runtime-worker(ThreadId(10)) [1P:ssh\op-agent-controller\src\desktop.rs:285] SSH Agent has started.
- Former Member
So I am having issues having 1password play agent for git bash, but it seems like everything works out of the box for powershell and cmd...
- Former Member
When you imported your keys into 1Password, did you save them in your Personal or Private vault, and not in some other vault that you might have added to 1Password? I was running into the same issue, and I finally got it to work by moving the key into the Personal vault. Apparently that does make a difference; custom vaults do not appear to be supported. After reading through this thread, I wasn't sure if anyone suggested that or if you had verified the location of your SSH keys within 1Password.
- floris_1P
1Password Team
Can you open the 1Password settings, toggle the SSH agent off and on and see if anything relevant appears in the 1Password logs at that moment? On Windows:
%LOCALAPPDATA%/1Password/logs
- PurplProtoOccasional Contributor
Ah good spot there!
sadly still no dice though (_click to expand_)
```sh PS C:\Users\PurplProto> dir .\.ssh\ Directory: C:\Users\PurplProto\.ssh Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 25/03/2022 10:06 backup -a---- 08/02/2022 22:07 10 authorized_keys -a---- 22/03/2022 15:22 2426 known_hosts -a---- 16/02/2022 23:40 507 known_hosts.old PS C:\Users\PurplProto> $env:SSH_AUTH_SOCK = '\\.\pipe\openssh-ssh-agent' PS C:\Users\PurplProto> echo $env:SSH_AUTH_SOCK \\.\pipe\openssh-ssh-agent PS C:\Users\PurplProto> ssh -Tv git@github.com OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 debug1: Connecting to github.com [140.82.121.3] port 22. debug1: Connection established. debug1: identity file C:\\Users\\PurplProto/.ssh/id_rsa type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_rsa-cert type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_dsa type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_dsa-cert type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_ecdsa type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_ecdsa-cert type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_ed25519 type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_ed25519-cert type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_xmss type -1 debug1: identity file C:\\Users\\PurplProto/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1 debug1: Remote protocol version 2.0, remote software version babeld-4f04c79d debug1: no match: babeld-4f04c79d debug1: Authenticating to github.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC:compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM debug1: Host 'github.com' is known and matches the ECDSA host key. debug1: Found key in C:\\Users\\PurplProto/.ssh/known_hosts:5 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory debug1: Will attempt key: C:\\Users\\PurplProto/.ssh/id_rsa debug1: Will attempt key: C:\\Users\\PurplProto/.ssh/id_dsa debug1: Will attempt key: C:\\Users\\PurplProto/.ssh/id_ecdsa debug1: Will attempt key: C:\\Users\\PurplProto/.ssh/id_ed25519 debug1: Will attempt key: C:\\Users\\PurplProto/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs= debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: C:\\Users\\PurplProto/.ssh/id_rsa debug1: Trying private key: C:\\Users\\PurplProto/.ssh/id_dsa debug1: Trying private key: C:\\Users\\PurplProto/.ssh/id_ecdsa debug1: Trying private key: C:\\Users\\PurplProto/.ssh/id_ed25519 debug1: Trying private key: C:\\Users\\PurplProto/.ssh/id_xmss debug1: No more authentication methods to try. git@github.com: Permission denied (publickey). PS C:\Users\PurplProto> ``` - floris_1P
1Password Team
I'm seeing
ssh_get_authentication_socket: No such file or directory
and seeing\.\pipe\openssh-ssh-agent
, could you try with a double backslash at the beginning:\\.\pipe\openssh-ssh-agent