Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
AlmoEnd
2 years agoDedicated Contributor
1password git support for ssh in WSL2?
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
5 Replies
- clcavanaughNew Contributor
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.
- 1P_Phil
Moderator
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
- AlmoEndDedicated Contributor
Above isn't a workable workaround :) After a reboot
ssh-add ~/.ssh/1p_github
looks like I'll have to run
Could not open a connection to your authentication agent.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? - AlmoEndDedicated Contributor
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. - AlmoEndDedicated Contributor
Can I somehow store the SSH key in the ~/.ssh folder in a Ubuntu 22.04 distro?