PowerShell / Win32-OpenSSH

Win32 port of OpenSSH
7.2k stars 739 forks source link

No SSH public key authentication using smartcard and jumphost (Linux) #2188

Closed cmonty14 closed 4 months ago

cmonty14 commented 6 months ago

Prerequisites

Steps to reproduce

I connect a Nitrokey security-token (that is comparable to Yubikey) with OpenPGP keys to my client. And I want to use this Nitrokey for SSH login to remote servers.

For this I installed GPG4Win on my client and configured file gpg-agent.conf:

enable-ssh-support
enable-putty-support
#To Enable support for the native Microsoft OpenSSH binaries (requires gpg 2.4.0 / Gpg4win 4.1.0 or higher)
enable-win32-openssh-support
use-standard-socket
default-cache-ttl 600
max-cache-ttl 7200

Then I (re-) start the gpg-agent and try to SSH into the Jumphost using command ssh (in Windows PowerShell profile). Here I get a popup window where I must enter the PIN previously set on Nitrokey. After this I'm connected to the jumphost shell (Linux).

Now I want to connect to the target server using command ssh. Here I must enter my user password.

I think this fails because SSH agent forwarding is not working.

Expected behavior

Public key authentication for SSH connection to any target server from jumphost.

Actual behavior

I need to enter (user) password requested by target server.

Environment data

Windows Terminal version 1.18.2822.0

Windows build number 11.0.22621.2715

Other Software Gpg4win 4.2.0

Version

OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

maertendMSFT commented 6 months ago

What OS is the target machine running?

cmonty14 commented 5 months ago

What OS is the target machine running?

Mainly Linux incl. jumphost.

maertendMSFT commented 4 months ago

Can you provide us with the command that you are running and the client and server logs?