benpye / wsl-ssh-pageant

A Pageant -> TCP bridge for use with WSL, allowing for Pageant to be used as an ssh-ageant within the WSL environment.
BSD 2-Clause "Simplified" License
612 stars 40 forks source link

Powershell Integration #47

Closed Outek closed 1 year ago

Outek commented 3 years ago

Hi

It would be very useful, if this would work with Powershell too.


# Version
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.0
PSEdition                      Core
GitCommitId                    7.1.0
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

# Run exe
.\wsl-ssh-pageant-amd64-gui.exe --winssh ssh-pageant -force

# Export
$env:SSH_AUTH_SOCK="\\.\pipe\winssh-pageant"

# Echo
$env:SSH_AUTH_SOCK
\\.\pipe\winssh-pageant

Is there a way to use this within Powershell?

benpye commented 3 years ago

Sorry - missed this issue. I use almost exclusively from PowerShell, are you talking about using it for PowerShell sessions over SSH or just ssh from PowerShell?

Outek commented 3 years ago

Just for ssh from Powershell

benpye commented 3 years ago

It should work today, I'm a little surprised it doesn't. If you run wsl-ssh-pageant with --verbose do you get any output when attempting to SSH?

mastqe commented 2 years ago

@Outek I believe your issue may be that you are setting the environment variable with the wrong pipe name. The name should match what you pass to the --winssh argument. So in this case it would be '\.\pipe\ssh-pageant' or update the argument to match the environment variable ('winssh-pageant').

benpye commented 1 year ago

Good catch @mastqe ! I'm going to close this issue as it looks like you spotted the issue, and @Outek hasn't replied since.