Install OpenSSH
On Windows 11 after upgrading the service did not start reporting "
System error 1067 has occurred.". It seems that the problem is because of theC:\ProgramData\ssh\logsdirectory permissions.
Removint this directory allows starting of OpenSSH service.
Capabilities
List the capabilities matching OpenSSH*.
Using Powershell command line and execute the following to enable the Windows capabilities.
As of writing, version 0.0.1.0.
So check the latest versions.
SSH Daemon Config
Modify file %PROGRAMDATA%\ssh\sshd_config.
Comment out the next lines located at the bottom of the file.
Since the first user is also an administrator.
Change file entry at the beginning named AuthorizedKeysFile as follows to use in the Cygwin folder located .ssh directory.
Change the DefautShell string value in the registry or create it when it does not exist.
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\cygwin64\sshd.bat" -PropertyType String -Force
When done restart the sshd service.
Using powershell.
Instead, use the command prompt.
Unblock sshd Service Port 22
# Create a firewall rule to allow Port 22
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Configure Cygwin Shell
Create the batch file %SystemDrive%\cygwin64\sshd.bat with the following content.
It sets the home directory for the Cygwin bash session by calling the existing Cygwin.bat file.
Debugging
Run the sshd.exe with option -ddd where the amount of D's stands vor the level of debugging.