Skip to content

Instantly share code, notes, and snippets.

@sdktr
sdktr / Agent Passthru.md
Last active April 10, 2025 08:08 — forked from Jaykul/Agent Passthru.md
SSH Agent passthru to WSL 2 (working, in Windows 11, in April 2025)

SSH ssh agent /w WSL2

  • SSH agent running in Windows (e.g. Keeper or Keeper Commander)
  • The resulting PIPE in windows is relayed to WSL2 and made available as an SSH socket under the well known environment variable SSH_AUTH_SOCK
  • Additional filtering of the offered keys is applied on the SSH client side using ssh.conf

Installation

With Chocolatey, you must use an elevated PowerShell session. If there's no choco command found, it will fall back to winget for the npiperelay install. To force using Winget even if you have choco installed, you need to download it, so you can pass parameters to it.

Easy mode: just run this in PowerShell: