The steps to install the OpenSSH server is straightforward, that is, to follow the team's instructions:
This instruction applies to both 32-bit and 64-bit binaries at its release page. Two problems I encountered are,
Setting up SSH Server Host Key
To run the OpenSSH Server, we ought to set up the host keys for the SSH server. We complete this in two steps:
- Create the C:\ProgramData\ssh directory, i.e., as Administrator issuing command
mkdir C:\ProgramData\ssh
- Create SSH server host keys, i.e., running the following as Administrator
C:\Program Files\OpenSSH\ssh-keygen.exe -A
PS C:\Program Files\OpenSSH> .\ssh-keygen -A
ssh-keygen: generating new host keys: RSA Could not save your public key in __PROGRAMDATA__\\ssh/ssh_host_rsa_key.temp_file_suffix: No such file or directory
ssh-keygen: generating new host keys: DSA Could not save your public key in __PROGRAMDATA__\\ssh/ssh_host_dsa_key.temp_file_suffix: No such file or directory
ssh-keygen: generating new host keys: ECDSA Could not save your public key in __PROGRAMDATA__\\ssh/ssh_host_ecdsa_key.temp_file_suffix: No such file or directory
ssh-keygen: generating new host keys: ED25519 Could not save your public key in __PROGRAMDATA__\\ssh/ssh_host_ed25519_key.temp_file_suffix: No such file or directory
Correcting Files and Directory Permissions
Another problem is that the following command to start the SSH server failed:
net start sshd
The error message is,
The SSHD service is starting. The SSHD service could not be started.
A system error has occurred.
System error 1067 has occurred.
The process terminated unexpectedly.
On a different occasion, I also encounter an error message like,
Error code 5: Access is denied. (Create File)
It turns out that the directories hosting the OpenSSH server binaries and keys had wrong permissions. Luckily, this is easy to fix thanks to the powershell script provided by the Powershell team. To fix the permission issues, we run the FixHostFilePermissions.ps1 and FixUserFilePermissions.ps1 scripts in the OpenSSH server directory, e.g.,
- Open a Windows Command Prompt window or a PowerShell window as Administrator
- Assume that your OpenSSH server binaries are in directory C:\Program Files\OpenSSH, run the following in the Windows Command Prompt window or the PowerShell Window
cd "C:\Program Files\OpenSSH" powershell -ExecutionPolicy Bypass -File FixHostFilePermissions.ps1 powershell -ExecutionPolicy Bypass -File FixUserFilePermissions.ps1
Notes Of A Programmer: Setting Up Openssh Server On Windows 7 Hosts >>>>> Download Now
ReplyDelete>>>>> Download Full
Notes Of A Programmer: Setting Up Openssh Server On Windows 7 Hosts >>>>> Download LINK
>>>>> Download Now
Notes Of A Programmer: Setting Up Openssh Server On Windows 7 Hosts >>>>> Download Full
>>>>> Download LINK rN