I can't get 1Pass ssh-agent working at all on Windows

PurplProto
PurplProto
Community Member
edited March 2022 in SSH

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_) ![](https://us.v-cdn.net/5020219/uploads/editor/8j/utjb0kf8sl87.png "")
I have the OpenSSH Client installed (_click to expand_) ![](https://us.v-cdn.net/5020219/uploads/editor/44/n2pzcscrfydj.png "")

For step 1:

I opted to import my existing keys (_click to expand_) ![](https://us.v-cdn.net/5020219/uploads/editor/3d/dbzzobsntncq.png "")

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_) ![](https://us.v-cdn.net/5020219/uploads/editor/h1/t6ku9jzdm8v2.png "")
I've enabled the SSH settings options in the 1Password app (_click to expand_) ![](https://us.v-cdn.net/5020219/uploads/editor/cf/2m5xu1u0gso3.png "")

Step 4:

Configured the agent

In Gitbash (_click to expand_) ![](https://us.v-cdn.net/5020219/uploads/editor/2h/lggu27hcp6ft.png "")
In PowerShell (_click to expand_) ![](https://us.v-cdn.net/5020219/uploads/editor/ch/f14gg1eewvqp.png "")

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_) ![](https://us.v-cdn.net/5020219/uploads/editor/oi/y0mc7z7ntl4h.png "")

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: 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=<ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss>
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).

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.GetChildItemCommand
Then 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_) ![](https://us.v-cdn.net/5020219/uploads/editor/o2/vs8cyemgzv6f.png "")

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

Comments

  • Thanks for the detailed report! Could you try unsetting SSH_AUTH_SOCK and IdentityAgent? And then share your ssh -v output and ssh-add -l output?

  • PurplProto
    PurplProto
    Community Member
    edited March 2022

    Hey, thanks for the reply!

    Sorry for my delayed reply, I've added the terminal log below 😊

    terminal log (_click to expand_) ```sh PurplProto@Corvo:~$ ls .ssh/ authorized_keys backup config known_hosts known_hosts.old PurplProto@Corvo:~$ # Backup folder contains my keys. Moved in there for the purpose of testing that 1Pass ssh-agent is working PurplProto@Corvo:~$ unset SSH_AUTH_SOCK PurplProto@Corvo:~$ echo $SSH_AUTH_SOCK PurplProto@Corvo:~$ head -n 4 .ssh/config Host * ServerAliveInterval 60 # IdentityAgent "~/.1password/agent.sock" PurplProto@Corvo:~$ # Commented out the IdentityAgent line PurplProto@Corvo:~$ ssh -Tv git@github.com OpenSSH_8.8p1, OpenSSL 1.1.1m 14 Dec 2021 debug1: Reading configuration data /c/Users/PurplProto/.ssh/config debug1: /c/Users/PurplProto/.ssh/config line 1: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: Connecting to github.com [140.82.121.4] 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_ecdsa_sk type -1 debug1: identity file /c/Users/PurplProto/.ssh/id_ecdsa_sk-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_ed25519_sk type -1 debug1: identity file /c/Users/PurplProto/.ssh/id_ed25519_sk-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_8.8 debug1: Remote protocol version 2.0, remote software version babeld-4f04c79d debug1: compat_banner: no match: babeld-4f04c79d debug1: Authenticating to github.com:22 as 'git' debug1: load_hostkeys: fopen /c/Users/PurplProto/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ssh-ed25519 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: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU debug1: load_hostkeys: fopen /c/Users/PurplProto/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: Host 'github.com' is known and matches the ED25519 host key. debug1: Found key in /c/Users/PurplProto/.ssh/known_hosts:3 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: 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_ecdsa_sk debug1: Will attempt key: /c/Users/PurplProto/.ssh/id_ed25519 debug1: Will attempt key: /c/Users/PurplProto/.ssh/id_ed25519_sk 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_ecdsa_sk debug1: Trying private key: /c/Users/PurplProto/.ssh/id_ed25519 debug1: Trying private key: /c/Users/PurplProto/.ssh/id_ed25519_sk debug1: Trying private key: /c/Users/PurplProto/.ssh/id_xmss debug1: No more authentication methods to try. git@github.com: Permission denied (publickey). PurplProto@Corvo:~$ ssh-add -l Could not open a connection to your authentication agent. PurplProto@Corvo:~$ ```

    EDIT:
    Just in case my config was causing any issues, I temporarily removed it and tried the GitHub key test again:

    Just having IdentityAgent set (_click to expand_) ```sh PurplProto@Corvo:~$ ls .ssh/ authorized_keys backup known_hosts known_hosts.old PurplProto@Corvo:~$ echo $SSH_AUTH_SOCK PurplProto@Corvo:~$ ssh -Tvo "IdentityAgent=~/.1password/agent.sock" git@github.com # Redacted most of the log otherwise post would be too long debug1: No more authentication methods to try. git@github.com: Permission denied (publickey). PurplProto@Corvo:~$ ```
    Just having SSH_AUTH_SOCK set (_click to expand_) ```sh PurplProto@Corvo:~$ ls .ssh/ authorized_keys backup known_hosts known_hosts.old PurplProto@Corvo:~$ echo $SSH_AUTH_SOCK PurplProto@Corvo:~$ SSH_AUTH_SOCK=~/.1password/agent.sock ssh -Tv git@github.com # Redacted most of the log otherwise post would be too long debug1: No more authentication methods to try. git@github.com: Permission denied (publickey). PurplProto@Corvo:~$ ```
  • And if you try it from PowerShell again, with IdentityAgent or SSH_AUTH_SOCK unset?

    And what happens if you run with IdentityAgent or SSH_AUTH_SOCK set to \\.\pipe\openssh-ssh-agent?

  • PurplProto
    PurplProto
    Community Member
    Both unset (_click to expand_) ```sh PS C:\Users\PurplProto> dir .\.ssh\ Directory: C:\Users\PurplProto\.ssh Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 24/03/2022 16:47 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> Remove-Item Env:SSH_AUTH_SOCK PS C:\Users\PurplProto> echo $env:SSH_AUTH_SOCK 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.4] port 22. debug1: Connection established. # Redacted most of the log to fit within post charecter limit 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> ```
    With only SSH_AUTH_SOCK set (_click to expand_) ```sh PS C:\Users\PurplProto> dir .\.ssh\ Directory: C:\Users\PurplProto\.ssh Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 24/03/2022 16:47 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.4] port 22. debug1: Connection established. # Redacted most of the log to fit within post charecter limit 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> ```
    With only IdentityAgent set (_click to expand_) ```sh PS C:\Users\PurplProto> dir .\.ssh\ Directory: C:\Users\PurplProto\.ssh Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 24/03/2022 16:47 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> Remove-Item Env:SSH_AUTH_SOCK PS C:\Users\PurplProto> echo $env:SSH_AUTH_SOCK PS C:\Users\PurplProto> ssh -Tvo "IdentityAgent=\.\pipe\openssh-ssh-agent" git@github.com OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 debug1: Connecting to github.com [140.82.121.4] port 22. debug1: Connection established. # Redacted most of the log to fit within post charecter limit 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> ```

    Still no luck here 😥

  • PurplProto
    PurplProto
    Community Member

    For added sanity, just to ensure we're using Microsoft's SSH and not the Gitbash SSH

    PS C:\Users\PurplProto> (gcm ssh.exe).Path
    C:\Windows\System32\OpenSSH\ssh.exe
    
  • 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

  • PurplProto
    PurplProto
    Community Member

    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
    edited March 2022

    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

  • subzero2000
    subzero2000
    Community 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.

  • steven_appleseed
    steven_appleseed
    Community 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...

  • PurplProto
    PurplProto
    Community Member

    @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.
    
  • PurplProto
    PurplProto
    Community Member

    @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.

  • Kitforbes
    Kitforbes
    Community Member

    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.

  • Kitforbes
    Kitforbes
    Community Member

    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".

  • PurplProto
    PurplProto
    Community Member

    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 using socat, 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.

This discussion has been closed.