PowerShell / PowerShell/Win32-OpenSSH

Agent Forwarding Windows client to Windows host not working?

Open
#1,865 13 comments 35 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0 - Backlog Area-ssh-agent Investigate Issue-Bug
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Originally posted here: https://github.com/PowerShell/openssh-portable/issues/540 , but was asked to open an issue here

"OpenSSH for Windows" version
8.1.0.1

Server OperatingSystem
Windows 10 Enterprise

Client OperatingSystem
Windows 10 Pro

What is failing
Unable to forward ssh keys through agent forwarding from windows client -> windows server

Is agent forwarding supported when connecting from a windows client to a windows host machine ?

I tried all of the things below, but had no luck and stumbled across this comment https://github.com/PowerShell/Win32-OpenSSH/issues/1136#issuecomment-500549297 which says Agent forwarding is not supported on the server yet, but you should be able to use the client to forward agent to a non-Windows target.

Was following these instructions from github : https://docs.github.com/en/developers/overview/using-ssh-agent-forwarding

  1. used keygen to generate public/private keys and added public to github.com
  2. ssh-add "location of private key". Can see them on client machine through ssh-add -l
  3. Test using agent
PS C:\Users\monil> ssh -T git@github.com
Hi monil-patel! You've successfully authenticated, but GitHub does not provide shell access.
  1. Specified ForwardAgent in the ssh config
Host my-pc
  HostName host...
  User username
  IdentityFile C:\Users\user\.ssh\id_rsa
  ForwardAgent yes

  1. ssh to my-pc, and run ssh -T git@github.com again

Expected output

# ssh session
PS C:\Users\monil> ssh -T git@github.com
Hi monil-patel! You've successfully authenticated, but GitHub does not provide shell access.

Actual output

# ssh session
git@github.com: Permission denied (publickey).

Cant list any keys under the ssh session

# ssh session
C:\Users\monil>ssh-add -l
Error connecting to agent: No such file or directory

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking the Win32-OpenSSH agent-forwarding behavior for a Windows client connecting to a Windows host, using the provided ForwardAgent configuration and ssh-add commands. Reproduce the session and verify whether the forwarded agent can be listed and authenticate to GitHub; done means confirming support and documenting the limitation or making that flow work.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.