Closed ivan closed 3 years ago
My dumb wrapper program to work around this for now:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
putenv("PATH=C:\\cygwin\\bin");
execv("/bin/ssh", argv);
}
Hello, The error you provided is actually from ssh-sk-helper.exe, not my dll, if you try with internal implementation you will see same error. ssh-sk-helper needs some dll files to be able to load properly, if you don't want to set cygwin bin dir into your path, you can copy all the DLLs it need to the same directory where ssh-sk-helper is(dirty, but will do the job)
Ah, thank you very much for taking a look. I didn't realize cygwin ssh / ssh-sk-helper
itself was at fault, but that appears to be the case. I will close this.
C:\Users\at>C:\cygwin\bin\ldd C:/cygwin/usr/sbin/ssh-sk-helper.exe
ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7fffb9ed0000)
KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7fffb9060000)
KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7fffb7af0000)
C:\Users\at>set PATH=C:\cygwin\bin;%PATH%
C:\Users\at>C:\cygwin\bin\ldd C:/cygwin/usr/sbin/ssh-sk-helper.exe
ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7fffb9ed0000)
KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7fffb9060000)
KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7fffb7af0000)
cygcrypto-1.1.dll => /usr/bin/cygcrypto-1.1.dll (0x3ff5c0000)
cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
cygfido2-1.dll => /usr/bin/cygfido2-1.dll (0x3ff0a0000)
SETUPAPI.dll => /cygdrive/c/WINDOWS/System32/SETUPAPI.dll (0x7fffb9550000)
msvcrt.dll => /cygdrive/c/WINDOWS/System32/msvcrt.dll (0x7fffb9df0000)
cygz.dll => /usr/bin/cygz.dll (0x3fbf90000)
cfgmgr32.dll => /cygdrive/c/WINDOWS/System32/cfgmgr32.dll (0x7fffb7620000)
ucrtbase.dll => /cygdrive/c/WINDOWS/System32/ucrtbase.dll (0x7fffb76d0000)
cyggcc_s-seh-1.dll => /usr/bin/cyggcc_s-seh-1.dll (0x3feed0000)
cygcbor-0.dll => /usr/bin/cygcbor-0.dll (0x3ffb30000)
HID.DLL => /cygdrive/c/WINDOWS/SYSTEM32/HID.DLL (0x7fffb5e80000)
RPCRT4.dll => /cygdrive/c/WINDOWS/System32/RPCRT4.dll (0x7fffb9290000)
bcrypt.dll => /cygdrive/c/WINDOWS/System32/bcrypt.dll (0x7fffb7e60000)
Thank you for this very useful helper program. I have noticed a potential issue when built for cygwin. I followed https://github.com/tavrez/openssh-sk-winhello#install and added
SecurityKeyProvider /usr/lib/winhello.dll
to my~/.ssh/config
. Everything works fine when ssh is run inside a proper Cygwin shell withC:\cygwin\bin
in PATH, but does not work (ssh-sk-helper.exe
errors out as seen below) whenssh.exe
is run outside a Cygwin shell, e.g. aC:\cygwin\bin\ssh.exe
shortcut or from vscode.I believe this can be made to work because Cygwin's DLLs work without
C:\cygwin\bin
in PATH, but I do not know how yet.I tested with an updated cygwin on Windows 10 2004.