Skip to main content
June 29, 2024
Question

1password git support for ssh in WSL2?

  • June 29, 2024
  • 4 replies
  • 545 views

I am only able to sync with Github using PATs; for some reason the SSH key is not retrieved, using VSCode with WSL extension, or from a command (zsh) shell I get access denied (publickey) when issuing git pull or git push commands. In a windows powershell or VSCode instance, behavior is "normal" and I'm prompted for access to the SSH key(s).


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser: Not Provided

4 replies

AlmoEndAuthor
June 29, 2024

Can I somehow store the SSH key in the ~/.ssh folder in a Ubuntu 22.04 distro?

AlmoEndAuthor
June 29, 2024

I "solved" the issue by creating a new ed25519 key with ssh-keygen in WSL/Ubuntu. I then overwrote the contents of .pub and with my saved 1P github SSH items' public and encrypted private key. Then I ran ssh-add and was prompted for the passphrase I used for encryption of the private key. Subsequent pulls and pushes (and VSCode with WSL extension) worked without prompt, but it felt like a bit of a hack. Guess WSL isn't on the dev team's radar.

AlmoEndAuthor
June 29, 2024

Above isn't a workable workaround :) After a reboot ssh-add ~/.ssh/1p_github
Could not open a connection to your authentication agent.
looks like I'll have to run eval \ssh-agent -s` and enter the password each time. Can I import the toml file into WSL to make 1P take charge of SSH connections in the VM?

August 10, 2025

Sorry for the little bit of necromancy replying here, it just happened to be near the top of the results when i googled this issue.

I was able to get this working in a similar manner to the way you work with the ssh-agent in WSL (I'm using the Ubuntu LTS version). Basically running 

git.exe clone git@gitlab.com:project/project.git

 it was able to interact with the ssh-agent.exe setup.

Probably a bit more to it technically but it works. Went ahead and aliased `ssh`->`ssh.exe` and `git` -> `git.exe` and everything works as I'd expect atm.

August 14, 2025

Hi @clcavanaugh ,

No problems from our side for sure!

Hey, we are glad you were able to get it to work. Drop a note any time!

Thanks,
Phil