PowerShell / PowerShell/Win32-OpenSSH

ssh-add -s fails

Open
#1,548 8 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

"OpenSSH for Windows" version
8.1.0.0

Client OperatingSystem
Windows 10 Enterprise

What is failing
ssh-add -s 'C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll'

Using the -s "Add keys from PKCS#11 provider", i.e. using ssh-agent with smart cards does not work.

Expected output

Identity added ...

Actual output

Enter passphrase for PKCS#11:
Could not add card "C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll": communication with agent failed

ssh-add is able to communicate with the agent. ssh-add without any options adds the default .ssh/id_rsa file, ssh-add -l is able to list it. ssh-add -s PKCS#11 does not work, although it does prompt for a PIN, so it obviously recognizes the -s option.

FWIW, ssh.exe is able to use a smart card with the option -I 'C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll', it's just ssh-agent that is failing.

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

Reproduce the Windows 10 failure with ssh-add -s and the provided OpenSC PKCS#11 DLL, then compare it with ssh-add -l and ssh -I using the same provider. Trace the ssh-add and ssh-agent communication path involved in PKCS#11 loading; done means the provider is added successfully and the smart card can be used through ssh-agent.

Written by the indexing model from the issue text.

Assessment

Domain
authentication, operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.