PowerShell / PowerShell/Win32-OpenSSH
How to compile ssh withU2F-Support
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 8.3k
- Forks
- 819
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am interested in an ssh-client with U2F-Support. I read the building page, but it fails to compile in CLI and GUI Mode.
first, I'm not sure if I should submit this issue to PowerShell/Win32-OpenSSH or PowerShell/openssh-portable. Could you please clarify which repo is good for what? I am from the Linux world and I am not exactly sure how to read the .sln file. Is it correct you have to manually update this file to make it work with Visual Studio 22?
How to attach log files to have them readable here? They seem to get scrambled.
Thanks,
Michael!
CLI:
`
PS C:\Users\molli> git clone https://github.com/PowerShell/openssh-portable
PS C:\Users\molli> cd .\openssh-portable
PS C:\Users\molli\openssh-portable> ipmo .\contrib\win32\openssh\OpenSSHBuildHelper.psm1 -Force
PS C:\Users\molli\openssh-portable> Start-OpenSSHBuild -Configuration Release -NativeHostArch x64
installing visualcpp-build-tools
The variable '$packageName' cannot be retrieved because it has not been set.
At C:\Users\molli\openssh-portable\contrib\win32\openssh\OpenSSHBuildHelper.psm1:237 char:69
- ... te-BuildMsg -AsError -ErrorAction Stop -Message "$packageName install ...
-
~~~~~~~~~~~~- CategoryInfo : InvalidOperation: (packageName:String) [], RuntimeException
- FullyQualifiedErrorId : VariableIsUndefined
vcbuildtools not present. Installing vcbuildtools ...
Write-BuildMsg : vcbuildtools installation failed with error code 1.
At C:\Users\molli\openssh-portable\contrib\win32\openssh\OpenSSHBuildHelper.psm1:293 char:13
-
Write-BuildMsg -AsError -ErrorAction Stop -Message "$pack ... -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
- FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-BuildMsg
PS C:\Users\molli\openssh-portable>
`
GUI (no matter if I convert the Project file or not)
Build started...
1>------ Build started: Project: config, Configuration: Release x64 ------
1>Generate crtheaders.h and config.h; fetch libressl sdk
1>Copy install-sshd.ps1, uninstall-sshd.ps1, OpenSSHUtils.psm1, OpenSSHUtils.psd1, FixHostFilePermissions.ps1, FixUserFilePermissions.ps1, ssh-add-hostkey.ps1, sshd_config (as sshd_config_default), openssh-events.man, moduli to build directory
1>C:\Users\molli\source\repos\openssh-portable\contrib\win32\openssh\install-sshd.ps1
1> 1 file(s) copied.
1>C:\Users\molli\source\repos\openssh-portable\contrib\win32\openssh\uninstall-sshd.ps1
1> 1 file(s) copied.
1>C:\Users\molli\source\repos\openssh-portable\contrib\win32\openssh\OpenSSHUtils.psd1
1>C:\Users\molli\source\repos\openssh-portable\contrib\win32\openssh\OpenSSHUtils.psm1
1> 2 file(s) copied.
1>C:\Users\molli\source\repos\openssh-portable\contrib\win32\openssh\FixHostFilePermissions.ps1
1>C:\Users\molli\source\repos\openssh-portable\contrib\win32\openssh\FixUserFilePermissions.ps1
1> 2 file(s) copied.
1> 1 file(s) copied.
1> 1 file(s) copied.
1> 1 file(s) copied.
1> 1 file(s) copied.
2>------ Build started: Project: posix_compat, Configuration: Release x64 ------
2>w32fd.c
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\direct.h(117,10): warning C4030: first formal parameter list longer than the second list
2>signal.c
2>socketio.c
2>fileio.c
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(452,14): warning C4028: formal parameter 2 different from declaration
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\direct.h(117,10): warning C4030: first formal parameter list longer than the second list
2>termio.c
2>misc.c
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\direct.h(117,10): warning C4030: first formal parameter list longer than the second list
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(452,14): warning C4028: formal parameter 2 different from declaration
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(495,1): error C2143: syntax error: missing ')' before '('
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(495,1): error C2059: syntax error: ')'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(495,14): error C2143: syntax error: missing ')' before ';'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(495,14): error C2091: function returns function
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(493,1): error C2373: 'w32_isatty': redefinition; different type modifiers
2>C:\Users\molli\source\repos\openssh-portable\contrib\win32\win32compat\inc\unistd.h(33): message : see declaration of 'w32_isatty'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(509,14): warning C4028: formal parameter 2 different from declaration
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(521,1): error C2143: syntax error: missing ')' before '('
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(521,1): error C2059: syntax error: ')'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(521,1): error C2059: syntax error: '('
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(521,1): error C2143: syntax error: missing ')' before 'type'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(521,1): error C2091: function returns function
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(518,1): error C2373: 'w32_open': redefinition; different type modifiers
2>C:\Users\molli\source\repos\openssh-portable\contrib\win32\win32compat\inc\fcntl.h(20): message : see declaration of 'w32_open'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(521,1): error C2085: '_OpenFlag': not in formal parameter list
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(521,1): error C2059: syntax error: '...'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(529,14): warning C4028: formal parameter 3 different from declaration
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_io.h(564,14): warning C4028: formal parameter 3 different from declaration
2>C:\Users\molli\source\repos\openssh-portable\contrib\win32\win32compat\misc.c(563,40): warning C4028: formal parameter 2 different from declaration
2>C:\Users\molli\source\repos\openssh-portable\contrib\win32\win32compat\misc.c(761,6): warning C4996: 'w32_rmdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _rmdir. See online help for details.
2>C:\Users\molli\source\repos\openssh-portable\contrib\win32\win32compat\misc.c(873,1): warning C4029: declared formal parameter list different from definition
2>signal_sigalrm.c
2>signal_sigchld.c
2>w32api_proxies.c
2>win32_usertoken_utils.c
2>w32log.c
2>pwd.c
2>win32_dirent.c
2>no-ops.c
2>ansiprsr.c
2>console.c
2>tncon.c
2>tnnet.c
2>utf.c
2>spawn.c
2>Compiling...
2>signal_wait.c
2>win32_pty.c
2>gss-sspi.c
2>sshTelemetry.c
2>Done building project "win32iocompat.vcxproj" -- FAILED.
3>------ Build started: Project: ssh, Configuration: Release x64 ------
3>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1087,5): error MSB6006: "link.exe" exited with code 1181.
3>LINK : fatal error LNK1181: cannot open input file 'posix_compat.lib'
3>Done building project "ssh.vcxproj" -- FAILED.
========== Build: 1 succeeded, 2 failed, 2 up-to-date, 0 skipped ==========
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with contrib/win32/openssh/OpenSSHBuildHelper.psm1 and the Visual Studio build output from win32iocompat.vcxproj. Reproduce the CLI failure with Start-OpenSSHBuild and inspect the listed win32compat header errors and missing posix_compat.lib. Done means the documented Windows build completes successfully in both CLI and GUI modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, powershell
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100